Subject: Re: Unique key constraint Issue

From: Adrian Klaver <[email-masked]>
Date: Mon, 25 Nov 2024 08:00:04 -0800

On 11/25/24 00:44, shashidhar Reddy wrote:
> Hi Ajit,
> 
> Thank you for your reply!
> 
> The result of the query is same across all servers and yes streaming 
> replication does not have any issue but the question is how did 
> duplicate values entered when there unique key in place.

Corrupted index?

Have you tried doing a REINDEX?

-- 
Adrian Klaver
[email-masked]

---

From: shashidhar Reddy <[email-masked]>
Date: Tue, 26 Nov 2024 08:37:08 +0530

Hi Adrian,

Thank you for your response.

I don't think index corrupted as I can generate the ddl script from the
index and the index is still in use when we query.
 To rebuild the index we are still removing duplicate entries. But nothing
found in logs.

---

From: Adrian Klaver <[email-masked]>
Date: Mon, 25 Nov 2024 21:36:47 -0800

> I don't think index corrupted as I can generate the ddl script from the 

What DDL script?

> index and the index is still in use when we query.

See Tom Lanes post for more detail. Short version the index will still 
'work' except for the part where it lets in duplicate entries.

>   To rebuild the index we are still removing duplicate entries. But 
> nothing found in logs.
> 
> On Mon, 25 Nov, 2024, 9:30 pm Adrian Klaver, <[email-masked] 
> <mailto:[email-masked]>> wrote:
> 
>     [email-masked] <mailto:[email-masked]>
>

---

From: shashidhar Reddy <[email-masked]>
Date: Wed, 27 Nov 2024 08:02:45 +0530

Thank you Adrian.

We replicated the issue with OS upgrade.