diff options
author | Bruce Momjian <bruce@momjian.us> | 2009-01-07 21:48:15 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2009-01-07 21:48:15 +0000 |
commit | 12dcf7bb7552386c7a18d8a30b176718eb51c00e (patch) | |
tree | 0f62f2c774bc82e85165222384ee8e7978f230c0 /src/backend/utils/adt/misc.c | |
parent | deac9488d3715408665cac707c4994e96af8b535 (diff) |
Have current_query() use ActivePortal->sourceText rather than
debug_query_string; this allows current_query() to be more accurate;
docs updated; per idea from Tom
Diffstat (limited to 'src/backend/utils/adt/misc.c')
-rw-r--r-- | src/backend/utils/adt/misc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c index 2042f96f82a..bc068932e9d 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.68 2009/01/07 19:51:21 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.69 2009/01/07 21:48:15 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -31,6 +31,7 @@ #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)) @@ -59,11 +60,7 @@ current_database(PG_FUNCTION_ARGS) Datum current_query(PG_FUNCTION_ARGS) { - /* 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(); + PG_RETURN_TEXT_P(cstring_to_text(ActivePortal->sourceText)); } /* |