Re: Escaping special characters

From: Thom Brown <thombrown(at)gmail(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:31:36
Message-ID: bddc86150903170531y24430952n1472a0452b4cf4be@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> According to the documentation,
>
> INSERT INTO thing (name) VALUES ('Smith E'\\'& Jones');
>
> must work. But it doesn't. So, double the enclosed quotes:
>
> INSERT INTO thing (name) VALUES ('Smith E''\\''& Jones');
>
> Doesn't.
>
> It works fine, but with a warning, as
>
> INSERT INTO thing (name) VALUES ('Smith \\& Jones');
>
> 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.
>

I could be wrong, but shouldn't it be:

INSERT INTO thing (name) VALUES ('Smith E'\\& Jones');

I'm not sure why you're including an extra single or double-quote in the
string.

Regards

Thom

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-03-17 12:36:48 Re: Escaping special characters
Previous Message Subha Ramakrishnan 2009-03-17 12:31:03 Uploading data to postgresql database