Re: Backslashes in data in version 8.1.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
Cc: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Re: Backslashes in data in version 8.1.2
Date: 2006-02-19 22:23:01
Message-ID: 14282.1140387781@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mike Nolan <nolan(at)gw(dot)tssi(dot)com> writes:
> When I moved up to 8.1.2 one of my PHP programs appears to be broken,
> I am getting backslashes in my data that I don't want.
> Investigating further, I have found some inconsistencies in how verion
> 8.1.2 handles data with backslashes in it:

This has not changed from prior versions. It looks like you are
neglecting to allow for the fact that backslash is an escape character
both at the string-literal level and at the regex-pattern level.
Therefore you must write twice as many backslashes as you normally
would write in a regex pattern. In particular, '\\\\' to match a
literal backslash.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Nolan 2006-02-19 23:07:38 Re: Backslashes in data in version 8.1.2
Previous Message Tom Lane 2006-02-19 22:18:07 Re: restoring under a different owner?