Bug #470: INTERSECT fails - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #470: INTERSECT fails
Date
Msg-id 200109271416.f8REGkM33287@hub.org
Whole thread Raw
Responses Re: Bug #470: INTERSECT fails  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tamas Vincze (vincze@neb.com) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
INTERSECT fails

Long Description
I've used INTERSECT to get the common rows in 3 simple SELECTs.
If I write the query without grouping parentheses, PG reports 0 rows
which is incorrect. If I use parentheses to group the last two
SELECTs then it gives a better answer. If I reorder the SELECTs
then it gives another different answer. (see examples)
The result should be independent of the order and grouping of
the SELECTs, so I think it's a serious bug.
I use version 7.1.2 on solaris/sparc.


Sample Code
sites=# select recseq from frags where len>2222 and len<2406
sites-# intersect select recseq from frags where len>1503 and len<1627
sites-# intersect select recseq from frags where len>752 and len<814;
 recseq
--------
(0 rows)

sites=# select recseq from frags where len>2222 and len<2406
sites-# intersect (select recseq from frags where len>1503 and len<1627
sites(# intersect select recseq from frags where len>752 and len<814);
 recseq
--------
 CACTG
 CAGTG
 CASTG
 RGCGCY
 YAACCT
(5 rows)

sites=# select recseq from frags where len>1503 and len<1627
sites-# intersect select recseq from frags where len>752 and len<814
sites-# intersect select recseq from frags where len>2222 and len<2406;
 recseq
--------
 CACTG
 CAGTG
 RGCGCY
 YAACCT
(4 rows)


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: srinivas
Date:
Subject: is there any substitution for cursors
Next
From: srinivas
Date:
Subject: to pass an array and retrive an array from a function