Re: Problem escaping, nonstandard use of \\ in a string literal

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Warren Bell *EXTERN*" <warren(at)clarksnutrition(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Problem escaping, nonstandard use of \\ in a string literal
Date: 2008-08-18 07:15:36
Message-ID: D960CB61B694CF459DCFB4B0128514C202679EA5@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Warren Bell wrote:
> I am having a problem with escaping characters after upgrading to 8.3. I
> have changed the postgresql.conf file to contain:
>
> standard_conforming_strings = on
>
> I do not get the error:
>
> nonstandard use of \\ in a string literal
>
> anymore but now I am having a problem escaping certain characters like
> the apostrophe \'. I am now getting the following error:
>
> syntax error at or near "S" at character 282
>
> that is referring to an apostrophe in an insert statement.
>
> I am not escaping this character in my code. I am assuming that the
> driver is escaping it. I am using the postgresql-8.3-603.jdbc3.jar as
> the driver.
>
> I see that you can escape by doing E'Joe\'s', but how do I get this to
> work without going through my code and shouldn't this be done by the
> driver.

Could you send a short code sample for your problem?
It would make it easier for me to look.

Yours,
Laurenz Albe

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message rw2xg7h02 2008-08-18 21:40:34 Hint: parseSql(...) in AbstractJdbc2Statement.java can be optimized performance-wise
Previous Message Craig Ringer 2008-08-18 03:20:01 Re: Hello