Re: bytea char escaping - Mailing list pgsql-general

From Stephen Robert Norris
Subject Re: bytea char escaping
Date
Msg-id 1056510399.24406.8.camel@ws12.commsecure.com.au
Whole thread Raw
In response to Re: bytea char escaping  (Joe Conway <mail@joeconway.com>)
Responses Re: bytea char escaping  (Joe Conway <mail@joeconway.com>)
List pgsql-general
On Wed, 2003-06-25 at 12:24, Joe Conway wrote:
> Stephen Robert Norris wrote:
> > On Tue, 2003-06-24 at 22:42, Ivar wrote:
> >>What chars must be escaped in string and how exactly?
> >>From memory, you have to escape \ -> \\, ' -> \' and I think NULL to
> > \\000. I have a feeling that you need to escape all the non-printable
> > characters to \xxx escape codes, but I may be wrong there.
> >
> > I've just looked at my code to do all this, and I'm ashamed to say I
> > can't really work out what it escapes. Must document better.
>
> See:
> http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=datatype-binary.html
>
> HTH,
>
> Joe

Ah, yes. I remember that page. The funny thing about it is that it
doesn't actually say which strings _have_ to be escaped, just gives some
examples...

I always read the Table 5-8 example to indicate that 0-31, 127-255 and \
have to be escaped, but it's not stated anywhere...

    Stephen


--
Stephen Robert Norris <srn@commsecure.com.au>
CommSecure Australia Pty Ltd


pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: bytea char escaping
Next
From: Joe Conway
Date:
Subject: Re: bytea char escaping