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

From Bruce Momjian
Subject Re: fix log_min_duration_statement logic error
Date
Msg-id 200310052107.h95L76I23765@candle.pha.pa.us
Whole thread Raw
In response to Re: fix log_min_duration_statement logic error  (Rod Taylor <rbt@rbt.ca>)
Responses Re: fix log_min_duration_statement logic error
Re: fix log_min_duration_statement logic error
List pgsql-patches
Rod Taylor wrote:
-- Start of PGP signed section.
> > have also added code to convert end-of-line characters to \n and \r, and
> > doubles backslashes.  It also makes log_statement print as one line, and
> > shows pg_stat_activity as one line.  Without this fix, you get:
>
> And how does it look with what was originally a fairly readable 30 or 40
> line query?

Probably pretty long.  I think the pg_stat_activity case really needs
the "\n" because if not the query breaks the table output format.  Not
sure about log_statement or log_min_duration_statement.  Having it be
one line makes grep easy, and is probably easier for processing via
tools, but reading the log could be harder:

  LOG:  duration: 7.466 ms; select *\nfrom pg_class\nwhere oid = 3 and\nrelname = 'abcd' and\nrelkind = 'r'\norder by
relname;

The old format output was:

  LOG:  duration: 7.466 ms; select *
  from pg_class
  where oid = 3 and
  relname = 'abcd' and
  relkind = 'r'
  order by relname;

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.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Rod Taylor
Date:
Subject: Re: fix log_min_duration_statement logic error
Next
From: Tom Lane
Date:
Subject: Re: fix log_min_duration_statement logic error