Re: Escaping special characters - Mailing list pgsql-general

From Thom Brown
Subject Re: Escaping special characters
Date
Msg-id bddc86150903170531y24430952n1472a0452b4cf4be@mail.gmail.com
Whole thread Raw
In response to Escaping special characters  (Neanderthelle Jones <elle@view.net.au>)
Responses Re: Escaping special characters
List 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

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Records Number
Next
From: Richard Huxton
Date:
Subject: Re: Escaping special characters