Re: [HACKERS] logging statement levels

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] logging statement levels
Date: 2004-04-06 15:38:53
Message-ID: 200404061538.i36FcrN19375@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
> Bruce Momjian wrote:
>
> >Andrew Dunstan wrote:
> >
> >
> >>Unless I'm missing something, this patch has the effect that with values
> >>of "ddl" or "mod" for log_statement, a statement with a parse error
> >>will not be logged, which was what I hoped to avoid.
> >>
> >>
> >
> >Right. The query type can't be determined during a syntax error because
> >the parser couldn't identify the supplied command. I think that is
> >fine.
> >
> >What it does allow is to for 'all' to display the command before the
> >syntax error.
> >
> >
> >
>
> If I had to make a choice I'd go the other way.

Uh, what other way?

> However, I think with a little extra work it might be possible to have both.

Right now, the way it is done, only a real syntax error skips logging.
If you referenced an invalid table or something, it does print the log
just before the invalid table name mention.

How would we test the command type before hitting a syntax error? I
can't think of a way, and I am not sure it would even be meaningful.

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-04-06 15:41:28 Re: Function to kill backend
Previous Message Tom Lane 2004-04-06 15:36:21 Re: Function to kill backend

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2004-04-06 16:04:48 Re: [HACKERS] logging statement levels
Previous Message Andrew Dunstan 2004-04-06 15:21:54 Re: [HACKERS] logging statement levels