Re: Re: [COMMITTERS] pgsql: Adjust things so that the query_string of a cached plan and the

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Adjust things so that the query_string of a cached plan and the
Date: 2009-01-07 23:33:05
Message-ID: 200901072333.n07NX5E21191@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Tom Lane wrote:
> >> The alternative I was envisioning was to have it look at the
> >> ActivePortal's query string. However, if you prefer to define the
> >> function as returning the current client query, it's fine as-is.
> >> We should make sure the documentation explains it like that however.
>
> > Now that you told me about ActivePortal I have used that and it seems to
> > work fine. Patch attached and applied; documentation updated.
>
> Well, hold on a minute. I said that was an alternative to look at,
> not that it was necessarily better. Can you define in words of one
> syllable which queries will be exposed this way? I don't believe
> it's "all of them".

Well, if you call a pl function, it is going to show you the current SPI
function running rather than the user query. Because the comment next
to the function says:

* Expose the current query to the user (useful in stored procedures)

I assume the portal string is better for stored procedures then
debug_query_string for current_query().

As I remember, there was lots of objection to adding current_query()
because it seemed useless, but the stored procedure logic won us over,
and I assume the portal string is a better representation for that
usage. In fact, because the application knows the query string, you
could argue that anything that has more information than the client
query string is preferable.

But of course I might be wrong. ;-)

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-01-07 23:46:58 Re: Re: [COMMITTERS] pgsql: Adjust things so that the query_string of a cached plan and the
Previous Message Tom Lane 2009-01-07 22:56:50 Re: Re: [COMMITTERS] pgsql: Adjust things so that the query_string of a cached plan and the

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-01-07 23:37:56 Re: parallel restore
Previous Message Simon Riggs 2009-01-07 23:24:44 Re: Do we still need constraint_exclusion?