Re: Duplicate key error

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>, pgsql-general(at)postgresql(dot)org
Subject: Re: Duplicate key error
Date: 2021-03-04 16:42:16
Message-ID: 6cdec299-a677-03c4-2c8e-36560e052c9e@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/3/21 10:14 PM, Andrus wrote:
> Hi!
>> says something else is inserting/updating using that key value. So
>> obviously your script is not catching all the conflicts.
>
> > At this point your best bet is to monitor the Postgres log and see
> what else is happening at the time of the error. I'm guessing you will
> find another process working on that table.
>
> It looks like other process has added same row during trancaction.
>
> How to change script so that it works starting at Postgres 9.0 and does
> not cause error in this case ?

Since we have not actually seen the entire script nor have any idea what
the other process is, there is no way to answer this.

>
> Andrus.
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-03-04 16:58:30 Re: Schema in trigger in logical replication
Previous Message Mathias Zarick 2021-03-04 10:34:19 RE: problems with my community account on www.postgresql.org