Re: A possible use case for: "INSERT .. ON CONFLICT DO SELECT [FOR ..]"

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Marc-Olaf Jaschke <moj(at)dshare(dot)de>
Cc: pgsql-general(at)postgresql(dot)org, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: A possible use case for: "INSERT .. ON CONFLICT DO SELECT [FOR ..]"
Date: 2017-11-05 15:06:08
Message-ID: CAL9smLDAwsVyG2bNY7JeD9nGp0bFP5ZbGU0O+oviP==W_SWVjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Nov 4, 2017 at 6:41 PM, Marc-Olaf Jaschke <moj(at)dshare(dot)de> wrote:

> Perhaps I misunderstand the discussion but would "INSERT .. ON CONFLICT DO
> SELECT [FOR ..]" not provide a solution for the following use case?
>
> [ .. ]
>
> That works. But it is a bit inconvenient to write the pseudo update clause.
>

Right. This is exactly the use case for ON CONFLICT DO SELECT. The
"no-op" UPDATE bloats the table unnecessary and just generally results in
unnecessary overhead.

.m

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-11-05 15:41:24 Re: Runtime analysis
Previous Message Neto pr 2017-11-05 12:49:18 Runtime analysis