Re: Unique key constraint Issue - Mailing list pgsql-general

From ajit wangkhem
Subject Re: Unique key constraint Issue
Date
Msg-id CAMurXp115NcKB64EsksfSMJmztS_FBm0PuAmnXu_OXgh8MVz3w@mail.gmail.com
Whole thread Raw
In response to Unique key constraint Issue  (shashidhar Reddy <shashidharreddy001@gmail.com>)
Responses Re: Unique key constraint Issue
List pgsql-general
  Output should be consistent across servers below query o/p

SELECT conname, pg_get_constraintdef(oid)
FROM pg_constraint
WHERE conrelid = 'your table name'::regclass AND contype = 'u';
(different datatype combine in UK is not an issue). This issue may not happen in asynchronous, log shipping or streaming replication. In logical replication it may create problem.

On Mon, Nov 25, 2024 at 12:01 PM shashidhar Reddy <shashidharreddy001@gmail.com> wrote:
Hello,

We have postgresql servers with PostgreSQL 13.10   on Ubuntu release 22.04.

The issue is a unique key constraint with two columns one is character another is integer. At some point the unique key did not work as I see duplicate values with these two columns combination and it happened on multiple servers on multiple databases on same table with same unique key. I tried db dump and restore but the key is failing to create when restore with duplicate value errors.



pgsql-general by date:

Previous
From: shashidhar Reddy
Date:
Subject: Unique key constraint Issue
Next
From: ajit wangkhem
Date:
Subject: Re: Pg_basebackup failed or completed?