Re: Escaping special characters

From: Richard Huxton <dev(at)archonet(dot)com>
To: Neanderthelle Jones <elle(at)view(dot)net(dot)au>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Escaping special characters
Date: 2009-03-17 12:30:47
Message-ID: 49BF97F7.2060401@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Subha Ramakrishnan 2009-03-17 12:31:03 Uploading data to postgresql database
Previous Message Richard Huxton 2009-03-17 12:26:34 Re: Records Number