Re: fix log_min_duration_statement logic error - Mailing list pgsql-patches

From Tom Lane
Subject Re: fix log_min_duration_statement logic error
Date
Msg-id 14994.1065389143@sss.pgh.pa.us
Whole thread Raw
In response to Re: fix log_min_duration_statement logic error  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: fix log_min_duration_statement logic error
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.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.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: fix log_min_duration_statement logic error
Next
From: Tom Lane
Date:
Subject: Re: fix log_min_duration_statement logic error