Re: COPY-able sql log outputs - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: COPY-able sql log outputs
Date
Msg-id 46128038.6070108@dunslane.net
Whole thread Raw
In response to Re: COPY-able sql log outputs  ("FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au>)
Responses Re: COPY-able sql log outputs  ("FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au>)
List pgsql-patches
FAST PostgreSQL wrote:
>> Am Dienstag, 3. April 2007 20:33 schrieb FAST PostgreSQL:
>>
>>> Attached is the completed patch for the COPY-able sql log outputs.
>>>
>> Could you please remove random whitespace changes from this patch?
>>
>
> Done and attached.

Brief review of the CSV aspect only:

a. username and databasename should probably be quoted and escaped in
case they contain dangerous characters (even though that's unlikely)
b. calling pg_get_client_encoding() inside the loop in
escape_string_literal seems suboptimal. At the very least it should be
moved outside the loop so it's only called once per string.

cheers

andrew


pgsql-patches by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: [Fwd: Deferred Transactions, Transaction Guaranteeand COMMITwithout waiting]
Next
From: Tom Lane
Date:
Subject: Re: Fix CheckpointStartLock starvation