Re: Duplicate key error

From: Andrus <kobruleht2(at)hot(dot)ee>
To: Michael Lewis <mlewis(at)entrata(dot)com>
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:23:24
Message-ID: 65ad98da-fae5-83e1-6cf2-abe6fc513961@hot.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

>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.

This is an option. How to do update+insert in 9+  in SQL  ? Or should
plpgsql procedure created for this ?

After insert if other process inserts same key value, transaction still
ways. Should manual locking used or is there better method.

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2021-03-04 19:23:11 Re: Duplicate key error
Previous Message Michael Lewis 2021-03-04 18:13:57 Re: Duplicate key error