mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add missing dblink files.
This commit is contained in:
49
contrib/dblink/doc/execute
Normal file
49
contrib/dblink/doc/execute
Normal file
@ -0,0 +1,49 @@
|
||||
==================================================================
|
||||
Name
|
||||
|
||||
dblink_exec -- Executes an UPDATE/INSERT/DELETE on a remote database
|
||||
|
||||
Synopsis
|
||||
|
||||
dblink_exec(text connstr, text sql)
|
||||
- or -
|
||||
dblink_exec(text sql)
|
||||
|
||||
Inputs
|
||||
|
||||
connstr
|
||||
|
||||
standard libpq format connection string,
|
||||
e.g. "hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres password=mypasswd"
|
||||
If the second form is used, then the dblink_connect(text connstr) must be
|
||||
executed first.
|
||||
|
||||
sql
|
||||
|
||||
sql statement that you wish to execute on the remote host, e.g.:
|
||||
|
||||
insert into foo values(0,'a','{"a0","b0","c0"}');
|
||||
|
||||
Outputs
|
||||
|
||||
Returns status of the command
|
||||
|
||||
Notes
|
||||
1) dblink_open starts an explicit transaction. If, after using dblink_open,
|
||||
you use dblink_exec to change data, and then an error occurs or you use
|
||||
dblink_disconnect without a dblink_close first, your change *will* be
|
||||
lost.
|
||||
|
||||
Example usage
|
||||
|
||||
test=# select dblink_connect('dbname=dblink_test_slave');
|
||||
dblink_connect
|
||||
----------------
|
||||
OK
|
||||
(1 row)
|
||||
|
||||
test=# select dblink_exec('insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
|
||||
dblink_exec
|
||||
-----------------
|
||||
INSERT 943366 1
|
||||
(1 row)
|
Reference in New Issue
Block a user