Skip site navigation (1) Skip section navigation (2)

BUG #2391: "Similar to" pattern matching does not operate as documented

From: "Eric Noriega" <noriega(at)gwu(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2391: "Similar to" pattern matching does not operate as documented
Date: 2006-04-12 23:49:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2391
Logged by:          Eric Noriega
Email address:      noriega(at)gwu(dot)edu
PostgreSQL version: 7.0.5
Operating system:   Linux Fedora core 4
Description:        "Similar to" pattern matching does not operate as

As far as I can tell, this may be a bug in how the pattern matches.

db=# select 'tab' similar to '(a|b)';

db=# select 'tab' similar to 'a|b';

The doc says:  Like LIKE, the SIMILAR TO  operator succeeds only if its
pattern matches the entire string; this is unlike common regular expression
practice, wherein the pattern may match any part of the string.

If the second case is invalid as an expression (not clear in the
docs:Parentheses may be used to group items into a single logical item),
then the statement should fail, or return false, not return true.


pgsql-bugs by date

Next:From: Peter BrantDate: 2006-04-12 23:57:59
Subject: Re: right sibling is not next child
Previous:From: Bruce MomjianDate: 2006-04-12 21:46:39
Subject: Re: contrib/intarray/_int_gist.c

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group