Re: [GENERAL] Good Delimiter for copy command - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Good Delimiter for copy command
Date
Msg-id 7838.1234901692@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Good Delimiter for copy command  (David Fetter <david@fetter.org>)
List pgsql-hackers
David Fetter <david@fetter.org> writes:
> On Tue, Feb 17, 2009 at 05:17:40PM +0100, Marco Colombo wrote:
>> Is it possibile to use some unicode character which is unlikely to
>> appear in the data set as delimiter? Something like U+FFFC.

> No.  The delimiter needs to be one byte long at the moment.  The error
> message you're getting probably needs an update.  Bug?

>> $ psql -c "\copy test from '2.txt' delimiter ●"
>> ERROR:  COPY delimiter must be a single character
>> \copy: ERROR:  COPY delimiter must be a single character

In 8.3 and CVS HEAD these messages are phrased as "must be a single
ASCII character" which I suppose is someone's attempt at improving the
situation; but IMHO this has replaced an imprecision with a lie.  It
works fine with non-ASCII characters, if you're working in a single-byte
encoding (eg LATIN-n).

I think it should say "must be a single one-byte character" and not try
to talk down to the reader.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Questions about parsing boolean and casting to anyelement
Next
From: Pavel Stehule
Date:
Subject: Re: Questions about parsing boolean and casting to anyelement