Re: Good Delimiter for copy command

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Marco Colombo <pgsql(at)esiway(dot)net>, pgsql-general(at)postgresql(dot)org, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Good Delimiter for copy command
Date: 2009-02-17 20:14:52
Message-ID: 7838.1234901692@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

David Fetter <david(at)fetter(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Howard Cole 2009-02-17 20:18:54 pg_dump -F f
Previous Message Magnus Hagander 2009-02-17 18:02:58 Re: [GENERAL] 8.3 doc issue

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-02-17 21:10:46 Re: Questions about parsing boolean and casting to anyelement
Previous Message Tom Lane 2009-02-17 19:50:07 Re: Questions about parsing boolean and casting to anyelement