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-05 22:22:14
Message-ID: 200310052222.h95MMEF11943@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:
> > It is hard to understand how a tool would grab the query from the above
> > log except to look for another TAG: entry and stop there.
>
> That was pretty much the centerpiece of my complaint --- up to now it's
> been tremendously difficult to parse the PG logs automatically, and I
> think something along this line would make it much easier.
>
> I am inclined to think though that Bruce has done this in the wrong
> place. If we are going to try to enforce "no real newlines inserted as
> part of logged strings", then it ought to be done at a low level in
> elog.c where it will apply to *everything* that goes into the log, not
> just log_statement/log_duration. For example, we presently allow
> embedded newlines in DETAIL/HINT messages, which is fine for frontend
> messages but helps to render the log unparsable. Those should be
> \n-ified too if we are really interested in making the log easy to
> process.

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?

Also, my change to pg_stat_activity was wrong, as Rod pointed out --- it
is psql that should handle \n properly, because pgadmin already does.

--
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 Manfred Koizar 2003-10-05 22:29:13 Cannot dump/restore text value \N
Previous Message Bruce Momjian 2003-10-05 22:20:51 Re: fix log_min_duration_statement logic error