Re: Unworkable column delimiter characters for COPY - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Unworkable column delimiter characters for COPY
Date
Msg-id 18844.1198780321@sss.pgh.pa.us
Whole thread Raw
In response to Re: Unworkable column delimiter characters for COPY  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Unworkable column delimiter characters for COPY  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> I think at minimum we need to forbid b, f, n, r, t, v, which are the
>> control character representations currently recognized by COPY.
>> But I'm tempted to make it reject all 26 lower-case ASCII letters,
>> as a form of future-proofing.  Thoughts?

> Assuming this is only for non-CSV mode, it seems OK.

On looking closer, 'x', octal digits, and '.' would also be trouble.
So I made it reject a-z, 0-9, and dot.

It appears that the CSV mode is a few bricks shy of a load here as
well: it will let you do CSV DELIMITER '"' resulting in entirely
broken output.  It seems we ought to forbid delimiter from matching CSV
quote or escape characters.  I'll let you clean up that case though...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Spoofing as the postmaster
Next
From: Andrew Dunstan
Date:
Subject: Re: Unworkable column delimiter characters for COPY