Re: [BUGS] BUG #3799: csvlog skips some logs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUGS] BUG #3799: csvlog skips some logs
Date
Msg-id 21540.1197328909@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #3799: csvlog skips some logs  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: [BUGS] BUG #3799: csvlog skips some logs
Re: [BUGS] BUG #3799: csvlog skips some logs
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Another change I did was to change a "%.*s" to "%*s".  The "precision"
> marker seems useless AFAICT.

This is wrong, broken, will cause crashes on platforms where the PS
string is not null-terminated.  (Hint: .* is a maximum width, * is a
minimum width.)

Another thing I thought strange was the order of the added columns;
why isn't it more like the order in which they appear in the text
version?  In particular hint should probably come just after detail
and before context, and internal-query should also come before context
because when relevant it's usually more closely nested than the context
stack.

Otherwise the patch looks pretty sane to me.  I didn't do any testing
though.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Release Note Changes
Next
From: Andrew Chernow
Date:
Subject: PGparam proposal