1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Please apply attached patch to contrib/dblink. It adds named persistent

connections to dblink.

Shridhar Daithanka
This commit is contained in:
Bruce Momjian
2003-06-25 01:10:15 +00:00
parent 92798de02e
commit 8f337e86cd
10 changed files with 857 additions and 616 deletions

View File

@ -6,9 +6,14 @@ dblink_open -- Opens a cursor on a remote database
Synopsis
dblink_open(text cursorname, text sql)
dblink_open(text connname, text cursorname, text sql)
Inputs
connname
if three arguments are present, the first is taken as the specific
connection name to use; otherwise the unnamed connection is assumed
cursorname
a reference name for the cursor
@ -52,9 +57,14 @@ dblink_fetch -- Returns a set from an open cursor on a remote database
Synopsis
dblink_fetch(text cursorname, int32 howmany)
dblink_fetch(text connname, text cursorname, int32 howmany)
Inputs
connname
if three arguments are present, the first is taken as the specific
connection name to use; otherwise the unnamed connection is assumed
cursorname
The reference name for the cursor
@ -123,9 +133,14 @@ dblink_close -- Closes a cursor on a remote database
Synopsis
dblink_close(text cursorname)
dblink_close(text connname, text cursorname)
Inputs
connname
if two arguments are present, the first is taken as the specific
connection name to use; otherwise the unnamed connection is assumed
cursorname
a reference name for the cursor
@ -135,7 +150,8 @@ Outputs
Returns status = "OK"
Note
dblink_connect(text connstr) must be executed first.
dblink_connect(text connstr) or dblink_connect(text connname, text connstr)
must be executed first.
Example usage
@ -157,3 +173,20 @@ test=# select dblink_close('foo');
OK
(1 row)
select dblink_connect('myconn','dbname=regression');
dblink_connect
----------------
OK
(1 row)
select dblink_open('myconn','foo','select proname, prosrc from pg_proc');
dblink_open
-------------
OK
(1 row)
select dblink_close('myconn','foo');
dblink_close
--------------
OK
(1 row)