Re: [GENERAL] DISTINCT is not quite distinct

2006-11-06 Thread Florian Weimer
* Richard Huxton: > I take it SELECT DISTINCT bar... shows the same problem? SELECT bar FROM baz does *not* show the duplicate row. > If so, can you do: > SELECT OID,xmin,cmin,xmax,cmax,bar FROM baz > WHERE bar = Even if I force a complete index scan, I get xmin = 1007617 for both rows, the

Re: [GENERAL] DISTINCT is not quite distinct

2006-11-06 Thread Florian Weimer
* Tom Lane: >> According to EXPLAIN, an index scan on the bar column is used (using >> the underlying B-tree index). > > Do you mean an indexscan followed immediately by a Unique node? If > so, yeah, that would depend entirely on correct ordering of the > indexscan output to produce distinct resu

Re: [GENERAL] DISTINCT is not quite distinct

2006-11-06 Thread Tom Lane
Florian Weimer <[EMAIL PROTECTED]> writes: > I run this innocent query > CREATE TABLE foo AS SELECT DISTINCT bar FROM baz ORDER BY bar; > and the resulting table contains duplicate rows. 8-( > According to EXPLAIN, an index scan on the bar column is used (using > the underlying B-tree index). Do

Re: [GENERAL] DISTINCT is not quite distinct

2006-11-06 Thread Richard Huxton
Florian Weimer wrote: I run this innocent query CREATE TABLE foo AS SELECT DISTINCT bar FROM baz ORDER BY bar; and the resulting table contains duplicate rows. 8-( According to EXPLAIN, an index scan on the bar column is used (using the underlying B-tree index). This is with PostgreSQL 8.1.4

[GENERAL] DISTINCT is not quite distinct

2006-11-06 Thread Florian Weimer
I run this innocent query CREATE TABLE foo AS SELECT DISTINCT bar FROM baz ORDER BY bar; and the resulting table contains duplicate rows. 8-( According to EXPLAIN, an index scan on the bar column is used (using the underlying B-tree index). This is with PostgreSQL 8.1.4 (Debian package 8.1.4-6)