mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Implement current_query(), that shows the currently executing query.
At the same time remove dblink/dblink_current_query() as it is no longer necessary *BACKWARD COMPATIBILITY ISSUE* for dblink Tomas Doran
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/dblink.sgml,v 1.3 2007/12/06 04:12:09 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/dblink.sgml,v 1.4 2008/04/04 16:57:21 momjian Exp $ -->
|
||||
|
||||
<sect1 id="dblink">
|
||||
<title>dblink</title>
|
||||
@ -1346,49 +1346,6 @@ SELECT *
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="CONTRIB-DBLINK-CURRENT-QUERY">
|
||||
<refnamediv>
|
||||
<refname>dblink_current_query</refname>
|
||||
<refpurpose>returns the current query string</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
dblink_current_query() returns text
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para>
|
||||
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 <filename>dblink</>'s
|
||||
other functionality. It is provided since it is sometimes useful
|
||||
in generating queries to be forwarded to remote databases.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Return Value</title>
|
||||
|
||||
<para>Returns a copy of the currently executing query string.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Example</title>
|
||||
|
||||
<programlisting>
|
||||
test=# select dblink_current_query();
|
||||
dblink_current_query
|
||||
--------------------------------
|
||||
select dblink_current_query();
|
||||
(1 row)
|
||||
</programlisting>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="CONTRIB-DBLINK-GET-PKEY">
|
||||
<refnamediv>
|
||||
<refname>dblink_get_pkey</refname>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.425 2008/03/23 00:24:19 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.426 2008/04/04 16:57:21 momjian Exp $ -->
|
||||
|
||||
<chapter id="functions">
|
||||
<title>Functions and Operators</title>
|
||||
@ -10724,6 +10724,12 @@ select current_date + s.a as dates from generate_series(0,14,7) as s(a);
|
||||
<entry>user name of current execution context</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>current_query</function></literal></entry>
|
||||
<entry><type>text</type></entry>
|
||||
<entry>text of the currently executing query (might contain more than one statement)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>inet_client_addr</function>()</literal></entry>
|
||||
<entry><type>inet</type></entry>
|
||||
|
Reference in New Issue
Block a user