]> begriffs open source - ai-pg/blob - full-docs/man3/dblink_send_query.3
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man3 / dblink_send_query.3
1 '\" t
2 .\"     Title: dblink_send_query
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "DBLINK_SEND_QUERY" "3" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 dblink_send_query \- sends an async query to a remote database
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 dblink_send_query(text connname, text sql) returns int
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBdblink_send_query\fR
40 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\&.
41 .PP
42 After successfully dispatching an async query, completion status can be checked with
43 \fBdblink_is_busy\fR, and the results are ultimately collected with
44 \fBdblink_get_result\fR\&. It is also possible to attempt to cancel an active async query using
45 \fBdblink_cancel_query\fR\&.
46 .SH "ARGUMENTS"
47 .PP
48 \fIconnname\fR
49 .RS 4
50 Name of the connection to use\&.
51 .RE
52 .PP
53 \fIsql\fR
54 .RS 4
55 The SQL statement that you wish to execute in the remote database, for example
56 select * from pg_class\&.
57 .RE
58 .SH "RETURN VALUE"
59 .PP
60 Returns 1 if the query was successfully dispatched, 0 otherwise\&.
61 .SH "EXAMPLES"
62 .sp
63 .if n \{\
64 .RS 4
65 .\}
66 .nf
67 SELECT dblink_send_query(\*(Aqdtest1\*(Aq, \*(AqSELECT * FROM foo WHERE f1 < 3\*(Aq);
68 .fi
69 .if n \{\
70 .RE
71 .\}