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

Bug #470: INTERSECT fails

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #470: INTERSECT fails
Date: 2001-09-27 14:16:46
Message-ID: 200109271416.f8REGkM33287@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Tamas Vincze (vincze(at)neb(dot)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


Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-09-27 14:25:58
Subject: Re: bug! in 7.1.3 (for recursion function)
Previous:From: Vince VielhaberDate: 2001-09-27 14:14:43
Subject: Re: CVS rejected me

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