Re: [rfc] unicode escapes for extended strings - Mailing list pgsql-hackers

From Sam Mason
Subject Re: [rfc] unicode escapes for extended strings
Date
Msg-id 20090417174625.GF12225@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: [rfc] unicode escapes for extended strings  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: [rfc] unicode escapes for extended strings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [rfc] unicode escapes for extended strings
Next
From: Andrew Dunstan
Date:
Subject: Re: Replacing plpgsql's lexer