I have a table with a UNIQUE index with 12 columns. \d salesshows sales_uq UNIQUE, btree (a1, a2, a3, ... a12).
I execute 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 this possible ?! Is it possible that the index is there, but somehow disabled? Or may there be a problem with NULL? Or with floating point numbers (two columns in the index are of type double precision)?
source
share