]> begriffs open source - ai-pg/blob - full-docs/man3/dblink_close.3
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man3 / dblink_close.3
1 '\" t
2 .\"     Title: dblink_close
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_CLOSE" "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_close \- closes a cursor in a remote database
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 dblink_close(text cursorname [, bool fail_on_error]) returns text
36 dblink_close(text connname, text cursorname [, bool fail_on_error]) returns text
37 .fi
38 .SH "DESCRIPTION"
39 .PP
40 \fBdblink_close\fR
41 closes a cursor previously opened with
42 \fBdblink_open\fR\&.
43 .SH "ARGUMENTS"
44 .PP
45 \fIconnname\fR
46 .RS 4
47 Name of the connection to use; omit this parameter to use the unnamed connection\&.
48 .RE
49 .PP
50 \fIcursorname\fR
51 .RS 4
52 The name of the cursor to close\&.
53 .RE
54 .PP
55 \fIfail_on_error\fR
56 .RS 4
57 If true (the default when omitted) then an error thrown on the remote side of the connection causes an error to also be thrown locally\&. If false, the remote error is locally reported as a NOTICE, and the function\*(Aqs return value is set to
58 ERROR\&.
59 .RE
60 .SH "RETURN VALUE"
61 .PP
62 Returns status, either
63 OK
64 or
65 ERROR\&.
66 .SH "NOTES"
67 .PP
68 If
69 \fBdblink_open\fR
70 started an explicit transaction block, and this is the last remaining open cursor in this connection,
71 \fBdblink_close\fR
72 will issue the matching
73 \fBCOMMIT\fR\&.
74 .SH "EXAMPLES"
75 .sp
76 .if n \{\
77 .RS 4
78 .\}
79 .nf
80 SELECT dblink_connect(\*(Aqdbname=postgres options=\-csearch_path=\*(Aq);
81  dblink_connect
82 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
83  OK
84 (1 row)
85
86 SELECT dblink_open(\*(Aqfoo\*(Aq, \*(Aqselect proname, prosrc from pg_proc\*(Aq);
87  dblink_open
88 \-\-\-\-\-\-\-\-\-\-\-\-\-
89  OK
90 (1 row)
91
92 SELECT dblink_close(\*(Aqfoo\*(Aq);
93  dblink_close
94 \-\-\-\-\-\-\-\-\-\-\-\-\-\-
95  OK
96 (1 row)
97 .fi
98 .if n \{\
99 .RE
100 .\}