Unworkable column delimiter characters for COPY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Unworkable column delimiter characters for COPY
Date: 2007-12-27 15:37:07
Message-ID: 5426.1198769827@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Currently, copy.c rejects newline, carriage return, and backslash as
settings for the column delimiter character (in non-CSV mode). These
all seem necessary to avoid confusion. However, I just noticed that the
letters r, n, t, etc would also not work: on output, data characters
matching such a delimiter would get escaped as \r, \n, etc, which on
input would be read as C-style control characters.

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?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-12-27 16:39:29 Re: Binary data type with other output method
Previous Message Andreas 'ads' Scherbaum 2007-12-27 15:19:09 Re: Binary data type with other output method

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2007-12-27 16:58:50 Re: Unworkable column delimiter characters for COPY
Previous Message Hans-Juergen Schoenig 2007-12-27 08:37:19 CONNECT BY for 8.3 ...