use of / in ~ vs. ~*

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: pgsql-hackers(at)postgresql(dot)org
Subject: use of / in ~ vs. ~*
Date: 2000-09-26 22:00:30
Message-ID: 39D11C7E.C42282CB@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Can anyone explain why I must make / a character class
in case-insensitive query in order to match / ?

and then why does it work in plain ~ ?

hannu=> select * from item where path ~* '^/a';
path
------
/a/b/c
/a/b/d
/a/d/d
/aa/d
/a/b
/a/c
/a/d
(7 rows)

hannu=> select * from item where path ~ '^/a';
path
------
/a/b/c
/a/b/d
/a/d/d
/aa/d
/a/b
/a/c
/a/d
(7 rows)

hannu=> select * from item where path ~* '^/A';
path
----
(0 rows)

hannu=> select * from item where path ~* '^[/]A';
path
------
/a/b/c
/a/b/d
/a/d/d
/aa/d
/a/b
/a/c
/a/d
(7 rows)

------------
Hannu

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2000-09-26 22:06:48 RE: [GENERAL] update inside transaction violates unique constrain t?
Previous Message Hannu Krosing 2000-09-26 21:56:05 Re: RE: [GENERAL] update inside transaction violates unique constraint?