Search Postgresql Archives

Re: backslashes in 8.3.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



b == bmetcalf@xxxxxxxxxx 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux