Re: [GENERAL] Good Delimiter for copy command

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Good Delimiter for copy command
Дата
Msg-id 7838.1234901692@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Good Delimiter for copy command  (David Fetter <david@fetter.org>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Questions about parsing boolean and casting to anyelement
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Questions about parsing boolean and casting to anyelement