Re: Escaping special characters - Mailing list pgsql-general

From Richard Huxton
Subject Re: Escaping special characters
Date
Msg-id 49BF97F7.2060401@archonet.com
Whole thread Raw
In response to Escaping special characters  (Neanderthelle Jones <elle@view.net.au>)
List pgsql-general
Neanderthelle Jones wrote:
> About the string "Smith \& Jones".
>
> According to the documentation,
>
> INSERT INTO thing (name) VALUES ('Smith E'\\'& Jones');
>
> must work.  But it doesn't.

I think you'll find the documentation says to use:
    SELECT E'Smith \\& Jones';

Note that the "E" precedes the quoted string, it isn't embedded in it.
If there's an example in the docs that looks like yours, that's a bug.

> But it mightn't if I upgrade from 8.2.3.  Deprecated.  Can't risk it.
> So 40,000 years from now I'll be on 8.2.3.

Doubtful - you're missing 9 releases of bugfixes already. Probably find
all your data gets eaten by a bug long before then. Read the release
notes for 8.2.x and upgrade to 8.2.<latest> at your earliest convenience.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: Escaping special characters
Next
From: Sam Mason
Date:
Subject: Re: Escaping special characters