Re: backslashes in 8.3.3 - Mailing list pgsql-general

From Brandon Metcalf
Subject Re: backslashes in 8.3.3
Date
Msg-id Pine.LNX.4.58L.0806240925000.9186@cash.us.nortel.com
Whole thread Raw
In response to backslashes in 8.3.3  ("Brandon Metcalf" <bmetcalf@nortel.com>)
List pgsql-general
b == bmetcalf@nortel.com writes:

 b> I just upgraded to 8.3.3 from 8.1.5 and noticed that backslashes are
 b> handled completely differently now.  For example,


It looks like the default for escape_string_warning is now "on".
However, it says in the docs that future versions will treat the
backslash literally.

I suppose this means versions beyond 8.3.3?

But this is really an annoying change if I now have to go and escape
every backslash that we are inserting.


 b>   db=# insert into junk (cifs) values ('\\foooo\bar');
 b>   WARNING:  nonstandard use of \\ in a string literal
 b>   LINE 1: insert into junk (cifs) values ('\\foooo\bar');
 b>                                           ^
 b>   HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
 b>   INSERT 0 1
 b>   db=# select * from junk;
 b>        cifs
 b>   --------------
 b>    \foooo\x08ar
 b>   (1 row)

 b> Is there anyway to disable this behavior or fix this on the server
 b> side?  I really don't want to have to rework all of our code that
 b> inserts or queries data.

 b> It seems this works,

 b>   db=# insert into junk (cifs) values (E'\\\\foobar\\bar');
 b>   INSERT 0 1





--
Brandon

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: backslashes in 8.3.3
Next
From: "Brandon Metcalf"
Date:
Subject: Re: backslashes in 8.3.3