The following bug has been logged online:

Bug reference:      2391
Logged by:          Eric Noriega
Email address:      [EMAIL PROTECTED]
PostgreSQL version: 7.0.5
Operating system:   Linux Fedora core 4
Description:        "Similar to" pattern matching does not operate as
documented
Details: 

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

db=# select 'tab' similar to '(a|b)';
 ?column?
----------
 f

db=# select 'tab' similar to 'a|b';
 ?column?
----------
 t

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.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to