Re: Exec statement logging

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Exec statement logging
Date: 2005-05-15 03:08:01
Message-ID: 200505150308.j4F381Z05697@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > One thing you did was to log debug_query_string, but I don't see how
> > that could be the right value. I assume it would be empty in a
> > client-side execute, or be the previous query. I instead used "EXECUTE
> > portal_name" because that is what we are passed from the client.
>
> You could use portal->sourceText whenever that isn't null; it should be
> the querystring that the portal was created by.

Interesting, but right now we don't display the query using EXECUTE:

test=> SET client_min_messages='log';
SET
test=> SET log_statement = 'all';
SET
test=> PREPARE xx AS SELECT 1;
LOG: statement: PREPARE xx AS SELECT 1;
PREPARE
test=> EXECUTE xx;
LOG: statement: EXECUTE xx;
?column?
----------
1
(1 row)

test=>

so I assume client-side EXECUTE shouldn't either. Do people want it
displayed? The patch actually hard-codes the word EXECUTE after
"statement:" and prints the portal name:

LOG: statement: EXECUTE xx

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2005-05-15 08:56:11 Re: Exec statement logging
Previous Message Andrew Dunstan 2005-05-15 02:34:26 [Fwd: Re: [HACKERS] alternate regression dbs?]