public inbox for [email protected]
help / color / mirror / Atom feedUnique key constraint Issue
3+ messages / 2 participants
[nested] [flat]
* Unique key constraint Issue
@ 2024-11-25 06:30 shashidhar Reddy <[email protected]>
2024-11-25 07:51 ` Re: Unique key constraint Issue ajit wangkhem <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: shashidhar Reddy @ 2024-11-25 06:30 UTC (permalink / raw)
To: pgsql-general
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Unique key constraint Issue
2024-11-25 06:30 Unique key constraint Issue shashidhar Reddy <[email protected]>
@ 2024-11-25 07:51 ` ajit wangkhem <[email protected]>
2024-11-25 08:44 ` Re: Unique key constraint Issue shashidhar Reddy <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: ajit wangkhem @ 2024-11-25 07:51 UTC (permalink / raw)
To: shashidhar Reddy <[email protected]>; +Cc: 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 <
[email protected]> 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.
>
>
>
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Unique key constraint Issue
2024-11-25 06:30 Unique key constraint Issue shashidhar Reddy <[email protected]>
2024-11-25 07:51 ` Re: Unique key constraint Issue ajit wangkhem <[email protected]>
@ 2024-11-25 08:44 ` shashidhar Reddy <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: shashidhar Reddy @ 2024-11-25 08:44 UTC (permalink / raw)
To: ajit wangkhem <[email protected]>; +Cc: pgsql-general
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.
On Mon, 25 Nov, 2024, 1:21 pm ajit wangkhem, <[email protected]>
wrote:
> 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 <
> [email protected]> 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.
>>
>>
>>
>>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-11-25 08:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-25 06:30 Unique key constraint Issue shashidhar Reddy <[email protected]>
2024-11-25 07:51 ` ajit wangkhem <[email protected]>
2024-11-25 08:44 ` shashidhar Reddy <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox