Re: backslashes in 8.3.3

From: "Brandon Metcalf" <bmetcalf(at)nortel(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: backslashes in 8.3.3
Date: 2008-06-24 14:32:00
Message-ID: Pine.LNX.4.58L.0806240925000.9186@cash.us.nortel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

b == bmetcalf(at)nortel(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brandon Metcalf 2008-06-24 14:34:44 Re: backslashes in 8.3.3
Previous Message David Siebert 2008-06-24 14:30:14 Probably been asked a hundred times before.