pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Constantin Teodorescu <teo@flex.ro>
To: PostgreSQL Interfaces <pgsql-interfaces@postgresql.org>
To: pgsql-hackers@postgreSQL.org <pgsql-hackers@postgresql.org>
Subject: Broken select on regular expression  !!!
Date: Wed, 19 May 1999 13:49:57 +0000
Message-ID: <3742C185.F57328C0@flex.ro> (raw)

Hi all,

I think I have found a bug in regexp based selections.
Watch this :

create table regdemo (fld1 varchar(32));
CREATE
insert into regdemo values('410');
INSERT 726409 1
insert into regdemo values('7410');
INSERT 726410 1
insert into regdemo values('source');
INSERT 726411 1
insert into regdemo values('destination');
INSERT 726412 1
select * from regdemo where fld1 ~* '^sou|^des';
fld1
-----------
source
destination
(2 rows)

select * from regdemo where fld1 ~* '41|^des';
fld1
-----------
410
7410
destination
(3 rows)

select * from regdemo where fld1 ~* '^41|^des';
fld1
----
(0 rows)

^^^^^^^^^^^^^^
!?!?!?!
I thought it should return '410' and 'destination' rows. But it returns
nothing!
The first select example with ^ in both variants ( ^sou|^des ) works !!!
The last one ( ^41|^des ) don't !

Am I missing something?
I am getting the same result also on 6.4.2 and 6.5 beta 1 versions!

Best regards,
-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA



view thread (2+ messages)  latest in thread

Message-ID: <3742C185.F57328C0@flex.ro>
Permalink:  ../3742C185.F57328C0@flex.ro/
Also on:    postgresql.org/message-id/3742C185.F57328C0@flex.ro

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: teo@flex.ro, pgsql-hackers@postgresql.org
  Subject: Re: Broken select on regular expression  !!!
  In-Reply-To: <3742C185.F57328C0@flex.ro>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox