On Fri, Apr 17, 2009 at 07:01:47PM +0200, Martijn van Oosterhout wrote:
> On Fri, Apr 17, 2009 at 07:07:31PM +0300, Marko Kreen wrote:
> > Btw, is there any good reason why we don't reject \000, \x00
> > in text strings?
>
> Why forbid nulls in text strings?
As far as I know, PG assumes, like most C code, that strings don't
contain embedded NUL characters. The manual[1] has this to says:
The character with the code zero cannot be in a string constant.
I believe you're supposed to use values of type "bytea" when you're
expecting to deal with NUL characters.
--
Sam http://samason.me.uk/
[1] http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS