PG Bug reporting form <noreply@postgresql.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