PostgreSQL UNIQUE index not unique?

I have a table with a 12-column UNIQUE index. \d sales shows sales_uq UNIQUE, btree (a1, a2, a3, ... a12).

I do the following query:

SELECT a1, a2, a3, ... a12 FROM sales GROUP BY a1, a2, a3, ... a12 HAVING count(1) > 1;

and I get a bunch of results. How is that possible?! Is it possible that the index is there but somehow disabled? Or can there be some issue with NULLs? Or with floating point numbers (two of the columns in the index are of type double precision)?

5
задан ibz 17 August 2010 в 06:15
поделиться