Re: Duplicate key error - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: Duplicate key error
Date
Msg-id CAH2-Wz=bSrxrEF_xsz+jLgiqQqE=n2_PZPe-GzRsSz6k6-Vr9A@mail.gmail.com
Whole thread Raw
In response to Duplicate key error  (yudhi s <learnerdatabase99@gmail.com>)
Responses Re: Duplicate key error
List pgsql-general
On Mon, Nov 11, 2024 at 12:41 AM yudhi s <learnerdatabase99@gmail.com> wrote:
> So it means it will ensure no duplication happens for ID values, but still we are seeing "duplicate key" error. So
whatis the possible reason here or are we encountering any buggy behaviour here? 

MERGE doesn't actually make any promises about not getting unique
violations. Only ON CONFLICT DO UPDATE (and ON CONFLICT DO NOTHING)
make such a promise. That's the main reason why Postgres supports
both.

--
Peter Geoghegan



pgsql-general by date:

Previous
From: yudhi s
Date:
Subject: Re: Duplicate key error
Next
From: Mark Phillips
Date:
Subject: create policy statement USING clause