Re: Unicode escape codes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Campbell <ccampbell(at)cascadeds(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Unicode escape codes
Date: 2010-10-08 16:41:49
Message-ID: 4082.1286556109@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Chris Campbell <ccampbell(at)cascadeds(dot)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 unicode escape" 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Thangalin 2010-10-08 18:30:08 Re: PostgreSQL data types mapped Java classes for JDBC
Previous Message Chris Campbell 2010-10-08 15:52:03 Unicode escape codes