Re: Unicode escape codes - Mailing list pgsql-novice

From Tom Lane
Subject Re: Unicode escape codes
Date
Msg-id 4082.1286556109@sss.pgh.pa.us
Whole thread Raw
In response to Unicode escape codes  (Chris Campbell <ccampbell@cascadeds.com>)
List pgsql-novice
Chris Campbell <ccampbell@cascadeds.com> writes:
> Update data1.systeminfo SET aicompanyfile='C:\Users\Public\Documents\Intuit\QuickBooks\Company
Files\acme_rockets.QBW'

> The issue is that Postgres interprets the back slashes in the path name as escapes and errors out with "invalid
unicodeescape"  Okay, I get it.  Back slashes are symbols for escape codes. 

> So my question is, what options do I have other than "swapping out"
the offending back-slash for some other character, then having to
remember to swap it back after I fetch the table from the database?
There must be a more elegant solution.

You can double the backslashes ('C:\\Users...') or you can turn on
standard_conforming_strings.  The latter is best done only with
considerable testing, though, because it's likely to break anything
that knows backslashes are special.

            regards, tom lane

pgsql-novice by date:

Previous
From: Chris Campbell
Date:
Subject: Unicode escape codes
Next
From: Thangalin
Date:
Subject: Re: PostgreSQL data types mapped Java classes for JDBC