dblink_send_query

Name

dblink_send_query -- sends an async query to a remote database

Synopsis

   dblink_send_query(text connname, text sql)
   

Inputs

connname

The specific connection name to use.

sql

sql statement that you wish to execute on the remote host e.g. "select * from pg_class"

Outputs

Returns int. A return value of 1 if the query was successfully dispatched, 0 otherwise. If 1, results must be fetched by dblink_get_result(connname). A running query may be cancelled by dblink_cancel_query(connname).

Example

SELECT dblink_connect('dtest1', 'dbname=contrib_regression'); SELECT * FROM dblink_send_query('dtest1', 'SELECT * FROM foo WHERE f1 < 3') AS t1;