aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2009-01-08 00:13:22 +0000
committerBruce Momjian <bruce@momjian.us>2009-01-08 00:13:22 +0000
commit1c175cd76a9db7d6114139a28f838697e88306ba (patch)
tree5322fac6f9340d58f1de8ebba5c8b239d98f1dfc /src
parentae3c07522100d3b13e04dbd5890611bfb29e8215 (diff)
downloadpostgresql-1c175cd76a9db7d6114139a28f838697e88306ba.tar.gz
postgresql-1c175cd76a9db7d6114139a28f838697e88306ba.zip
Revert current_query() change to use debug_query_string again; add comment.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/misc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c
index bc068932e9d..904abb911b1 100644
--- a/src/backend/utils/adt/misc.c
+++ b/src/backend/utils/adt/misc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.69 2009/01/07 21:48:15 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.70 2009/01/08 00:13:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,7 +31,6 @@
#include "storage/pmsignal.h"
#include "storage/procarray.h"
#include "utils/builtins.h"
-#include "tcop/pquery.h"
#include "tcop/tcopprot.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
@@ -56,11 +55,16 @@ current_database(PG_FUNCTION_ARGS)
/*
* current_query()
* Expose the current query to the user (useful in stored procedures)
+ * We might want to use ActivePortal->sourceText someday.
*/
Datum
current_query(PG_FUNCTION_ARGS)
{
- PG_RETURN_TEXT_P(cstring_to_text(ActivePortal->sourceText));
+ /* there is no easy way to access the more concise 'query_string' */
+ if (debug_query_string)
+ PG_RETURN_TEXT_P(cstring_to_text(debug_query_string));
+ else
+ PG_RETURN_NULL();
}
/*