Re: BUG #16938: Duplicate records with same Primary Key

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: susanacastela(at)hotmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16938: Duplicate records with same Primary Key
Date: 2021-03-22 18:22:48
Message-ID: 641364.1616437368@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> We're running an instance of postgres 13.2 and some days ago we noticed
> duplicated rows with the same primary key.

If the key column is of a text type, you might have gotten bit by
operating-system-level changes of sorting rules, which would effectively
make indexes on text columns corrupt [1]. If so, reindexing is the
appropriate fix. There's work in progress to try to notice this sort
of problem automatically, but it's not done yet.

regards, tom lane

[1] https://wiki.postgresql.org/wiki/Locale_data_changes

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2021-03-22 20:58:20 Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch
Previous Message PG Bug reporting form 2021-03-22 17:28:56 BUG #16938: Duplicate records with same Primary Key