dblink_get_result

Name

Synopsis

Description

dblink_get_result collects the
results of an asynchronous query previously sent with
dblink_send_query. If the query is
not already completed, dblink_get_result will wait until it is.

Arguments

conname

Name of the connection to use.

fail_on_error

If true (the default when omitted) then an error thrown
on the remote side of the connection causes an error to
also be thrown locally. If false, the remote error is
locally reported as a NOTICE, and the function returns no
rows.

Return Value

For an async query (that is, a SQL statement returning rows),
the function returns the row(s) produced by the query. To use
this function, you will need to specify the expected set of
columns, as previously discussed for dblink.

For an async command (that is, a SQL statement not returning
rows), the function returns a single row with a single text
column containing the command's status string. It is still
necessary to specify that the result will have a single text
column in the calling FROM clause.

Notes

This function must
be called if dblink_send_query
returned 1. It must be called once for each query sent, and one
additional time to obtain an empty set result, before the
connection can be used again.