Re: fix log_min_duration_statement logic error

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: Rod Taylor <rbt(at)rbt(dot)ca>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix log_min_duration_statement logic error
Date: 2003-10-06 14:21:06
Message-ID: 200310061421.h96EL6819274@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:
> > Agreed. elog is the proper place, because then you guarantee that it is
> > all on one line. Is that OK? Do we have elogs that we want over
> > several lines? Is this something we can do at this stage in beta?
>
> As to the latter: sure. We've already hacked the formatting of the log
> output quite a bit since 7.3. Better to hit them with this too now,
> than spread the pain over multiple releases.
>
> As to the former: the only thing that seems debatable to me is what to
> do about the layout of the new multi-part ereport() messages. I would
> be inclined to go for one line per part, viz
> ERROR: blah blah blah
> DETAIL: blah blah\nblah blah
> HINT: blah blah\nblah blah\nblah blah
> but perhaps someone would like to argue for somehow collapsing all this
> to one line? If so, how exactly?

Are those lines sent to the elog as one write() or separate ones --- do
they always appear together in the log?

I had a new idea on output format. Instead of converting newline to
"\n", and double-escaping backslashes, we add a tab after any newline,
so the output looks like:

LOG: duration: 4.035 ms query: select *
from pg_language;

This makes the logs look better, and it is easier for script to grab
queries. Grep doesn't work as well, but I think that is OK.

--
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-patches by date

  From Date Subject
Next Message Tom Lane 2003-10-06 14:42:57 Re: fix log_min_duration_statement logic error
Previous Message Tom Lane 2003-10-06 13:48:46 Re: Open 7.4 items