Re: Duplicate key error

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Duplicate key error
Date: 2021-03-04 18:13:57
Message-ID: CAHOFxGqhRnBs5nSJAoFJ_7rVNmroWXjdfZ+gkxn9y6rYRJ92_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Why just do a plain update, relying on row level locking to serialize
requests properly, and then just do an insert where not exists? Is there
value in doing the delete? I don't see it.

Note- On conflict clause is supported from 9.5+ and that is already past
EOL. Upgrading to at least v10 is recommended.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2021-03-04 18:23:24 Re: Duplicate key error
Previous Message Tom Lane 2021-03-04 18:07:31 Re: Schema in trigger in logical replication