Re: Inexplicable duplicate rows with unique constraint

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Richard van der Hoff" <richard(at)matrix(dot)org>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Inexplicable duplicate rows with unique constraint
Date: 2020-01-16 17:11:24
Message-ID: 20c95566-bdab-49ec-b242-d5c8c9a23065@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard van der Hoff wrote:

> So, question: what could we be doing wrong to get ourselves into this
> situation?

OS/libc upgrades without reindexing come to mind.
See https://wiki.postgresql.org/wiki/Collations

> * At least one user reports that he has recently migrated his database
> from one server to another via a `pg_dump -C` and later piping into psql.

This kind of migration recreates indexes (since it recreates everything)
so it's not subject to the same hazard as an OS/libc upgrade without
reindexing. In fact it would detect the problem if it existed,
as the creation of the unique constraint in the new db would fail if the
data in the dump did not satisfy it.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2020-01-16 17:12:30 Re: Inexplicable duplicate rows with unique constraint
Previous Message Tom Lane 2020-01-16 17:08:38 Re: Inexplicable duplicate rows with unique constraint