Re: [GENERAL] Escaping special characters

2009-03-17 Thread Neanderthelle Jones
On Tue, 17 Mar 2009, Sam Mason wrote: > You're putting things in the wrong places! The "E" says that the > following literal is using C style escaping. I.e. you want to say: > > E'Smith \\& Jones' Thanks. Now I understand. Elle. -- Sent via pgsql-general mailing list (pgsql-general@post

Re: [GENERAL] Escaping special characters

2009-03-17 Thread Daniel Verite
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. So, double the enclosed quotes: INSERT INTO thing (name) VALUES ('Smith E''\\''& Jones'); The E can't b

Re: [GENERAL] Escaping special characters

2009-03-17 Thread Thom Brown
2009/3/17 Thom Brown > > 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 > Sorry, (damn copy & paste). I meant: INSERT INTO thing (name)

Re: [GENERAL] Escaping special characters

2009-03-17 Thread Sam Mason
On Tue, Mar 17, 2009 at 10:35:20PM +1030, 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. You're putting things in the wrong places! The "E" says that

Re: [GENERAL] Escaping special characters

2009-03-17 Thread Richard Huxton
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

Re: [GENERAL] Escaping special characters

2009-03-17 Thread Thom Brown
> > 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