2
.\" Title: dblink_send_query
3
.\" Author: The PostgreSQL Global Development Group
4
.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
6
.\" Manual: PostgreSQL 9.1beta1 Documentation
7
.\" Source: PostgreSQL 9.1beta1
10
.TH "DBLINK_SEND_QUERY" "3" "2011-04-27" "PostgreSQL 9.1beta1" "PostgreSQL 9.1beta1 Documentation"
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
14
.\" disable hyphenation
16
.\" disable justification (adjust text to left margin only)
18
.\" -----------------------------------------------------------------
19
.\" * MAIN CONTENT STARTS HERE *
20
.\" -----------------------------------------------------------------
22
dblink_send_query \- sends an async query to a remote database
26
dblink_send_query(text connname, text sql) returns int
30
\fBdblink_send_query\fR
31
sends a query to be executed asynchronously, that is, without immediately waiting for the result\&. There must not be an async query already in progress on the connection\&.
33
After successfully dispatching an async query, completion status can be checked with
34
\fBdblink_is_busy\fR, and the results are ultimately collected with
35
\fBdblink_get_result\fR\&. It is also possible to attempt to cancel an active async query using
36
\fBdblink_cancel_query\fR\&.
41
Name of the connection to use\&.
46
The SQL statement that you wish to execute in the remote database, for example
47
select * from pg_class\&.
51
Returns 1 if the query was successfully dispatched, 0 otherwise\&.
58
SELECT dblink_send_query(\(aqdtest1\(aq, \(aqSELECT * FROM foo WHERE f1 < 3\(aq);