Re: CopyReadLineText optimization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CopyReadLineText optimization
Дата
Msg-id 20191.1204831263@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CopyReadLineText optimization  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Ответы Re: CopyReadLineText optimization  (Andrew Dunstan <andrew@dunslane.net>)
Re: CopyReadLineText optimization  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Список pgsql-patches
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> Andrew Dunstan wrote:
>> We currently make the following assumption in the code:
>>
>> * These four characters, and the CSV escape and quote characters, are
>> * assumed the same in frontend and backend encodings.
>>
>> The four characters are the carriage return, line feed, backslash and dot.
>>
>> I think the requirement might well actually be somewhat stronger than
>> that: i.e. that none of these will appear as a non-first byte in any
>> multi-byte client encoding character.

> No, we don't require that, and we do handle it correctly.

I believe we *have to* handle it correctly, because backslash actually
does appear as a non-first byte in SJIS or some other Far Eastern
encoding.  In the CSV case such a restriction would be untenable anyway.

BTW, I notice that the code allows CSV escape and quote characters that
have the high bit set (in single-byte server encodings that is).  Is
this a good idea?  It seems like such are extremely unlikely to be the
same in two different encodings.  Maybe we should restrict to the ASCII
range?  Especially if the client encoding is multibyte ...

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: CopyReadLineText optimization
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: CopyReadLineText optimization