summaryrefslogtreecommitdiff
path: root/contrib/dblink/doc/cursor
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dblink/doc/cursor')
-rw-r--r--contrib/dblink/doc/cursor35
1 files changed, 34 insertions, 1 deletions
diff --git a/contrib/dblink/doc/cursor b/contrib/dblink/doc/cursor
index 3bc6bdb2fe5..7c9cc3cde25 100644
--- a/contrib/dblink/doc/cursor
+++ b/contrib/dblink/doc/cursor
@@ -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)