Re: UPDATE ... ON CONFLICT DO NOTHING

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: UPDATE ... ON CONFLICT DO NOTHING
Date: 2017-03-14 18:18:09
Message-ID: 4b7f0c7d-7bd6-72a9-e776-f77e3c634d44@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/14/2017 09:00 AM, Alexander Farber wrote:
> My initial idea has been not to use ON CONFLICT at all, but instead only
> UPDATE the words_reviews records (set "uid" or "author" to out_uid) for
> which NO EXISTS already such a record with PK (uid, author)... and then

I am afraid the logic is escaping me. If the record does not exist how
can you UPDATE it?

> DELETE the rest (as I can't update them without a conflict) but I
> haven't figured it out yet...
>
> Thank you anyway

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yasin Sari 2017-03-14 19:07:40 Re: UPDATE ... ON CONFLICT DO NOTHING
Previous Message Adrian Klaver 2017-03-14 18:04:00 Re: Maximum of connections in PG