Re: Log_statement behaviour a little misleading? - Mailing list pgsql-general

From Tom Lane
Subject Re: Log_statement behaviour a little misleading?
Date
Msg-id 20132.1074150837@sss.pgh.pa.us
Whole thread Raw
In response to Log_statement behaviour a little misleading?  (Mark Kirkwood <markir@paradise.net.nz>)
Responses Re: Log_statement behaviour a little misleading?
Re: Log_statement behaviour a little misleading?
List pgsql-general
Mark Kirkwood <markir@paradise.net.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?

            regards, tom lane

pgsql-general by date:

Previous
From: Mike Nolan
Date:
Subject: Re: Schemas not created on restore
Next
From: "Chris Travers"
Date:
Subject: Re: Postgress and MYSQL