F.11. dblink â connect to other PostgreSQL databases #
- dblink_connect â opens a persistent connection to a remote database
- dblink_connect_u â opens a persistent connection to a remote database, insecurely
- dblink_disconnect â closes a persistent connection to a remote database
- dblink â executes a query in a remote database
- dblink_exec â executes a command in a remote database
- dblink_open â opens a cursor in a remote database
- dblink_fetch â returns rows from an open cursor in a remote database
- dblink_close â closes a cursor in a remote database
- dblink_get_connections â returns the names of all open named dblink connections
- dblink_error_message â gets last error message on the named connection
- dblink_send_query â sends an async query to a remote database
- dblink_is_busy â checks if connection is busy with an async query
- dblink_get_notify â retrieve async notifications on a connection
- dblink_get_result â gets an async query result
- dblink_cancel_query â cancels any active query on the named connection
- dblink_get_pkey â returns the positions and field names of a relation's primary key fields
- dblink_build_sql_insert â builds an INSERT statement using a local tuple, replacing the primary key field values with alternative supplied values
- dblink_build_sql_delete â builds a DELETE statement using supplied values for primary key field values
- dblink_build_sql_update â builds an UPDATE statement using a local tuple, replacing the primary key field values with alternative supplied values
- dblink_connect_u â opens a persistent connection to a remote database, insecurely
dblink is a module that supports connections to other PostgreSQL databases from within a database session.
dblink can report the following wait events under the wait event type Extension.
DblinkConnectWaiting to establish a connection to a remote server.
DblinkGetConnectWaiting to establish a connection to a remote server when it could not be found in the list of already-opened connections.
DblinkGetResultWaiting to receive the results of a query from a remote server.
See also postgres_fdw, which provides roughly the same functionality using a more modern and standards-compliant infrastructure.