Skip site navigation (1) Skip section navigation (2)

Re: Unworkable column delimiter characters for COPY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unworkable column delimiter characters for COPY
Date: 2007-12-27 18:32:01
Message-ID: 18844.1198780321@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2007-12-27 19:23:12
Subject: Re: Unworkable column delimiter characters for COPY
Previous:From: Andrew SullivanDate: 2007-12-27 18:20:33
Subject: Re: Spoofing as the postmaster

pgsql-patches by date

Next:From: Andrew DunstanDate: 2007-12-27 19:23:12
Subject: Re: Unworkable column delimiter characters for COPY
Previous:From: Andrew DunstanDate: 2007-12-27 16:58:50
Subject: Re: Unworkable column delimiter characters for COPY

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group