1DBLINK_CLOSE(3)          PostgreSQL 15.4 Documentation         DBLINK_CLOSE(3)
2
3
4

NAME

6       dblink_close - closes a cursor in a remote database
7

SYNOPSIS

9       dblink_close(text cursorname [, bool fail_on_error]) returns text
10       dblink_close(text connname, text cursorname [, bool fail_on_error]) returns text
11

DESCRIPTION

13       dblink_close closes a cursor previously opened with dblink_open.
14

ARGUMENTS

16       connname
17           Name of the connection to use; omit this parameter to use the
18           unnamed connection.
19
20       cursorname
21           The name of the cursor to close.
22
23       fail_on_error
24           If true (the default when omitted) then an error thrown on the
25           remote side of the connection causes an error to also be thrown
26           locally. If false, the remote error is locally reported as a
27           NOTICE, and the function's return value is set to ERROR.
28

RETURN VALUE

30       Returns status, either OK or ERROR.
31

NOTES

33       If dblink_open started an explicit transaction block, and this is the
34       last remaining open cursor in this connection, dblink_close will issue
35       the matching COMMIT.
36

EXAMPLES

38           SELECT dblink_connect('dbname=postgres options=-csearch_path=');
39            dblink_connect
40           ----------------
41            OK
42           (1 row)
43
44           SELECT dblink_open('foo', 'select proname, prosrc from pg_proc');
45            dblink_open
46           -------------
47            OK
48           (1 row)
49
50           SELECT dblink_close('foo');
51            dblink_close
52           --------------
53            OK
54           (1 row)
55
56
57
58PostgreSQL 15.4                      2023                      DBLINK_CLOSE(3)
Impressum