Re: Log_statement behaviour a little misleading?

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: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, pgsql-general(at)postgresql(dot)org
Subject: Re: Log_statement behaviour a little misleading?
Date: 2004-01-25 00:35:43
Message-ID: 200401250035.i0P0Zh102892@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Mark Kirkwood <markir(at)paradise(dot)net(dot)nz> writes:
> > So setting "log_statement=true" does all *statements* - but not all
> > *executions* of each statement. Is this the intention?
>
> AFAIK this is an implementation artifact that's never really been
> discussed. Another aspect of the artifact is that SQL commands
> appearing in plpgsql functions will be logged only on first execution
> in a session.
>
> I think you could make a fair argument that "log_statement" ought to log
> only commands received from the client application. There would be real
> value in being able to trace execution of plpgsql functions, but such a
> feature would have very little to do with log_statement as it now
> stands. The fact that RI triggers issue SQL commands is an artifact of
> their implementation (and one that I believe Stephan and Jan would like
> to get rid of); they shouldn't be cluttering the log at all.
>
> At least that's what it seems like to me after a few moments'
> reflection. Other opinions out there?

I checked prepared queries and it looks like this:

LOG: statement: prepare xx as select 1;
LOG: statement: execute xx;

which seems OK by me. I have updated the docs to mention the behavior
mentioned above for PREPARE and PL/pgSQL.

--
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

Attachment Content-Type Size
unknown_filename text/plain 1.1 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2004-01-25 00:38:35 Re: Mailing list? was Postgress and MYSQL
Previous Message Lee Harr 2004-01-24 23:19:39 Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this function?