Re: Backslashes in data in version 8.1.2 - Mailing list pgsql-general

From Mike Nolan
Subject Re: Backslashes in data in version 8.1.2
Date
Msg-id 200602192307.k1JN7fv6024758@gw.tssi.com
Whole thread Raw
In response to Re: Backslashes in data in version 8.1.2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> 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.

Something must have changed, Tom, because neither of the following work
on the system where I now have 8.1.2 but do work on another system
running 7.4.5, and in both 8.0.2 and 8.1.2 on a third system:

select * from backtest where field ~ '\\\\';
field
-------
(0 rows)

select * from backtest where field like '%\\\\%';
field
-------
(0 rows)

Could this be a locale issue?  The one where it does not work uses the C
locale, the others use the default locale, en_US.UTF-8.
--
Mike Nolan

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Backslashes in data in version 8.1.2
Next
From: Mike Nolan
Date:
Subject: Re: Backslashes in data in version 8.1.2