PostgreSQL 8.3.3 Documentation
Prev | Fast Backward |  | Fast Forward | Next

# 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)

Prev | Home | Next
dblink_cancel_query | Up | dblink_get_pkey