Nathan Myers writes:
> Does the standard require any particular behavior in with NUL
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(at)gmx(dot)net http://funkturm.homeip.net/~peter
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2001-05-29 22:55:13|
|Subject: Re: Re: charin(), text_char() should return something else for empty input |
|Previous:||From: Peter Eisentraut||Date: 2001-05-29 21:03:36|
|Subject: Re: pg_log ??|