Re: Backslash problems with 8.1.4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Schumacher <matt(dot)s(at)aptalaska(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Backslash problems with 8.1.4
Date: 2006-06-07 17:46:50
Message-ID: 4485.1149702410@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Schumacher <matt(dot)s(at)aptalaska(dot)net> writes:
> Thanks for the reply Tom, however I don't think you understand my issue.
> I'm not using addslashes and I am using the SQL standard way to
> escape a single quote. The problem is that I want to put a literal \'
> inside the database. So if \ is no longer an escape character, and ''
> is the SQL way to pass a literal ' then you would think that \'' would
> put a literal \' into the database, however postgres rejects this and
> spits out an error.

Oh, you're mistaken about \ ... it's still an escape character, as of 8.1.
(Beginning in 8.2 there will be a way to make it not an escape.) So
what you need for that is \\'' inside your literal string.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Markus Schiltknecht 2006-06-07 17:48:00 Re: Problem with 'postgres' db with 8.0 on a MacBook
Previous Message Matthew Schumacher 2006-06-07 17:44:33 Re: Backslash problems with 8.1.4