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

SIMILAR TO bug?

From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: SIMILAR TO bug?
Date: 2009-02-18 15:37:00
Message-ID: 20090218153700.GA17588@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Folks,

Perhaps I've misunderstood this, but in PostgreSQL 8.3.5, I get
disparate results from ~ and SIMILAR TO.  For example:

This gives an unexpected result:

davidfetter(at)davidfetter=# SELECT 'abc' SIMILAR TO '^[a]';
 ?column? 
----------
 f
(1 row)

This one is what I expected.

davidfetter(at)davidfetter=# SELECT 'abc' ~ '^[a]';
 ?column? 
----------
 t
(1 row)

Did I misunderstand what SIMILAR TO does, or...?

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Responses

pgsql-hackers by date

Next:From: Gregory StarkDate: 2009-02-18 15:39:10
Subject: Re: pg_migrator progress
Previous:From: Peter EisentrautDate: 2009-02-18 15:32:03
Subject: Re: SE-PostgreSQL and row level security

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