Re: UTF8 with BOM support in psql

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: UTF8 with BOM support in psql
Дата
Msg-id 4ADDD38F.50804@dunslane.net
обсуждение исходный текст
Ответ на Re: UTF8 with BOM support in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: UTF8 with BOM support in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: UTF8 with BOM support in psql  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
>   
>> Seems there is community support for accepting BOM:
>>     http://archives.postgresql.org/pgsql-hackers/2009-09/msg01625.php
>>     
>
> That discussion has approximately nothing to do with the
> much-more-invasive change that Itagaki-san is suggesting.
>
> In particular I think an automatic change of client_encoding isn't
> particularly a good idea --- wouldn't you have to change it back later,
> and is there any possibility of creating a security issue from such
> behavior?  Remember that client_encoding *IS* tied to security issues
> such as backslash escape handling.
>
>     
>   

Yeah, I don't think we should be second-guessing the user on the encoding.

What I think we might sensibly do is to eat the leading BOM of an SQL 
file iff the client encoding is UTF8, and otherwise treat it as just 
bytes in whatever the encoding is.

Should we also do the same for files passed via \copy? What about 
streams on stdin? What about files read from the backend via COPY?

cheers

andrew




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Could postgres be much cleaner if a future release skipped backward compatibility?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Application name patch - v2