pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Марат Гасанян <marat_gasanyan@mail.ru>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: Problem with constraint unique.
Date: Thu, 12 Dec 2024 07:47:24 +0100
Message-ID: <0c1f6b24a56b4ee79331c656efce9ca622ffa0a1.camel@cybertec.at> (raw)
In-Reply-To: <1733928443.950047988@f125.i.mail.ru>
References: <1733928443.950047988@f125.i.mail.ru>

On Wed, 2024-12-11 at 17:47 +0300, Марат Гасанян wrote:
> I apologies for bothering your team, before send this message we google the
> problem and was not able to find any tips about it. Our project encounter
> with quite strange situation where we found violation of unique constraint
> of primary key. We have a table that has an attribute ID as PK. The table
> name enerstorymain_task_info. Surprisingly the query 
> select id, count(*) from  enerstroymain_task_info group by 1 having count(*) > 1
> return a lot of rows. Than we rechecked PK it is ok. So we supposed that
> some how we had dropped the PK and then created duplicates and than rebuild
> the PK, but in this case PK would not rebuild. To avoid any weird settings
> I run the query from PGAdmin and DBView from different computers.
> Also I doubt that any kind problem like repeatable red could be the reason
> due to insert operation is done only a server without any complicated query.
> I mean simple INSERT INTO ….

No, dropping and re-creating the constraint cannot be the explanation,
unless the primary key constraint is NOT VALID.

With "uuid", it also cannot be a collation problem.

The best thing to get rid of this data corruption is to delete the extra
entries and then to sump and restore the data to a new database.

Check if your hardware has problems.

Yours,
Laurenz Albe





view thread (5+ messages)  latest in thread

Message-ID: <0c1f6b24a56b4ee79331c656efce9ca622ffa0a1.camel@cybertec.at>
Permalink:  ../0c1f6b24a56b4ee79331c656efce9ca622ffa0a1.camel@cybertec.at/
Also on:    postgresql.org/message-id/0c1f6b24a56b4ee79331c656efce9ca622ffa0a1.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: laurenz.albe@cybertec.at, marat_gasanyan@mail.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: Problem with constraint unique.
  In-Reply-To: <0c1f6b24a56b4ee79331c656efce9ca622ffa0a1.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox