Re: Duplicate values found when reindexing unique index - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Duplicate values found when reindexing unique index
Date
Msg-id 19423.1199069646@sss.pgh.pa.us
Whole thread Raw
In response to Duplicate values found when reindexing unique index  ("Mason Hale" <masonhale@gmail.com>)
Responses Re: Duplicate values found when reindexing unique index  (Gregory Stark <stark@enterprisedb.com>)
Re: Duplicate values found when reindexing unique index  ("Mason Hale" <masonhale@gmail.com>)
List pgsql-bugs
"Mason Hale" <masonhale@gmail.com> writes:
> I found a single pair of rows that were duplicated. Interestingly it was not
> just the guid and feed_id that were duplicated but all columns were
> indentical, including the primary key, except an update_at column which is
> automatically populated via a trigger (BEFORE UPDATE on entry FOR EACH ROW).

> The duplicate data included a created_at column which defaults to now() --
> that the two duplicate rows have exactly the same values strongly hints to
> me that the duplicates were created during the same transaction.

Hmm, what sounds more likely to me is that both of those rows are
updated versions of the same original row.

> Here's the system column data you requested.

>     id     |     ctid     | xmin | xmax | cmin | cmax
> -----------+--------------+------+------+------+------
>  151341072 | (1508573,11) |    2 |    0 |   19 |    0
>  151341072 | (1818219,11) |    2 |    0 |   19 |    0
> (2 rows)

I wonder whether it's just a coincidence that these have the same offset
number...

The fact that both rows have been frozen (xmin=2) means we can't really
tell whether they originated in the same transaction or not.

Can you show us all the triggers on this table?  Also, it would be real
interesting to see "pg_filedump -i -f" output for the two blocks in
question (1508573 and 1818219) --- see http://sources.redhat.com/rhdb/
to get a copy of pg_filedump.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Duplicate values found when reindexing unique index
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #3841: core dump in uuid-ossp