Re: Re: charin(), text_char() should return something else for empty input

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Re: charin(), text_char() should return something else for empty input
Дата
Msg-id Pine.LNX.4.30.0105292310550.757-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: Re: charin(), text_char() should return something else for empty input  (ncm@zembu.com (Nathan Myers))
Ответы Re: Re: charin(), text_char() should return something else for empty input  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Nathan Myers writes:

> Does the standard require any particular behavior in with NUL
> characters?

The standard describes the behaviour of the character types in terms of
character sets.  This decouples glyphs, encoding, and storage.  So
theoretically you could (AFAICT) define a character set that encodes some
meaningful character with code zero, but the implementation is not
required to handle this zero byte internally, it could catch it during
input and represent it with an escape code.

The standard also defines some possible "built-in" character sets, such as
LATIN1 and UTF16.  Most of these do not naturally contain a character that
is encoded with the zero byte.  In the case of the ISO8BIT/ASCII_FULL
charset, the standard explicitly says that the zero byte is not contained
in the character set.

In general, I don't see a point in accepting a zero byte in character
strings.  If you want to store binary data there are binary data types (or
effort could be invested in them).

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pg_log ??
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: charin(), text_char() should return something else for empty input