Re: Exec statement logging - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Exec statement logging
Date
Msg-id 200505150308.j4F381Z05697@candle.pha.pa.us
Whole thread Raw
In response to Re: Exec statement logging  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: [Fwd: Re: [HACKERS] alternate regression dbs?]
Next
From: Simon Riggs
Date:
Subject: Re: Exec statement logging