Re: Backslashes in data in version 8.1.2

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Nolan 2006-02-19 23:24:33 Re: Backslashes in data in version 8.1.2
Previous Message Tom Lane 2006-02-19 22:23:01 Re: Backslashes in data in version 8.1.2