select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Unsupported versions: 8.3
Historical version. PostgreSQL 8.3 reached end of support in February 2013. See the current manual for supported releases.

dblink_current_query

Name

dblink_current_query -- returns the current query string

Synopsis

    dblink_current_query() returns text
   

Description

Returns the currently executing interactive command string of the local database session, or NULL if it can't be determined. Note that this function is not really related to dblink's other functionality. It is provided since it is sometimes useful in generating queries to be forwarded to remote databases.

Return Value

Returns a copy of the currently executing query string.

Example

test=# select dblink_current_query();
      dblink_current_query
--------------------------------
 select dblink_current_query();
(1 row)
   

Report a documentation issue

Read the upstream documentation. For corrections, first check the current manual.