Disallow digits and lower-case ASCII letters as the delimiter in non-CSV
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Dec 2007 18:28:58 +0000 (18:28 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Dec 2007 18:28:58 +0000 (18:28 +0000)
commitb076a9fe29fb9d690a875d217de199b7fe30ec2e
treee28d82ace362d231128f6c00c9e58cc3cfb1d59a
parent73edcaa9136e760b3ccf2457cc9114cb88d10adf
Disallow digits and lower-case ASCII letters as the delimiter in non-CSV
COPY.  We need a restriction here because when the delimiter occurs as a
data character, it is emitted with a backslash, and that will only work
as desired if CopyReadAttributesText() will interpret the backslash sequence
as representing the second character literally.  This is currently untrue
for 'b', 'f', 'n', 'r', 't', 'v', 'x', and octal digits.  For future-proofing
and simplicity of explanation, it seems best to disallow a-z and 0-9.
We must also disallow dot, since "\." by itself would look like copy EOF.
Note: "\N" is by default the null print string, so N would also cause a
problem, but that is already tested for.
src/backend/commands/copy.c