
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

Wed, 27 Sep 2000 01:00:30 +0300
Hannu Krosing <hannu@tm.ee>
use of / in ~ vs. ~*
Hannu Krosing <hannu@tm.ee> writes:
> Can anyone explain why I must make / a character class 
> in case-insensitive query in order to match / ?

What LOCALE are you using?  There was a thread about strange ordering
rules confusing the LIKE/regexp optimizer recently ...

			regards, tom lane

Tue, 26 Sep 2000 20:06:37 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: use of / in ~ vs. ~* 
Tom Lane wrote:
> 
> Hannu Krosing <hannu@tm.ee> writes:
> > Can anyone explain why I must make / a character class
> > in case-insensitive query in order to match / ?
> 
> What LOCALE are you using?  There was a thread about strange ordering
> rules confusing the LIKE/regexp optimizer recently ...


I think I'm using the default locale (this is just straight install on
Linux from RPM-s)

Is there any way to find out the locale used from within the running
system ?

The most obvious way ( select locale(); ) does not work .

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

Wed, 27 Sep 2000 09:31:43 +0300
Hannu Krosing <hannu@tm.ee>
Re: use of / in ~ vs. ~*
Hannu Krosing writes:

> I think I'm using the default locale (this is just straight install on
> Linux from RPM-s)
> 
> Is there any way to find out the locale used from within the running
> system ?

The locale the postmaster uses is whatever was set in its environment,
i.e., LC_ALL, etc.


-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Wed, 27 Sep 2000 12:51:04 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: use of / in ~ vs. ~*