pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Peter Geoghegan <pg@heroku.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
Date: Thu, 21 May 2015 15:42:17 +0300
Message-ID: <555DD2A9.202@iki.fi> (raw)
In-Reply-To: <CAM3SWZSu88Kbu_htJT1FfTWUkfaSd+8Q+oArbyX+SE5i2KPJ0w@mail.gmail.com>
References: <E1YqZCW-0000e6-Od@gemulon.postgresql.org>
	<20150520215816.GI5885@postgresql.org>
	<CAM3SWZRUhr1806zsF28CVRrB=b4t8PWv8d9x29z02xTQoFDyWA@mail.gmail.com>
	<20150520220911.GK5885@postgresql.org>
	<CAM3SWZQXP3Z=iXQ_+HwoqG7417JYf6HKDTmgk-4Xt05OEL_S_Q@mail.gmail.com>
	<CAM3SWZT0Rex4CpZo+re_m2Dh7wunMNsbD-9ZSWWx=JSewW3OVg@mail.gmail.com>
	<20150521011229.GX27868@alap3.anarazel.de>
	<10660.1432171328@sss.pgh.pa.us>
	<CAM3SWZSu88Kbu_htJT1FfTWUkfaSd+8Q+oArbyX+SE5i2KPJ0w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 05/21/2015 05:08 AM, Peter Geoghegan wrote:
> On Wed, May 20, 2015 at 6:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I am not really sure that it was a good idea to invent
>> this command tag.  In fact, I'm pretty sure it was a *bad* idea ---
>> what will happen if we ever create a statement actually named UPSERT?
>
> Why would we invent a statement actually named UPSERT?

And if we did, surely it would do some sort of an upsert operation, we 
could use the UPSERT command tag for that too.

That said, I'm also not sure adding the UPSERT command tag is worth the 
trouble. I'm OK with ripping it out. The row count returned in the 
command tag is handy in the simple cases, but it gets complicated as 
soon as you have rules or triggers, so you can't rely much on it anyway. 
So as long as we document what the count means for an INSERT ... ON 
CONFLICT, it should be OK to use the INSERT tag.

- Heikki



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (32+ messages)  latest in thread

Message-ID: <555DD2A9.202@iki.fi>
Permalink:  ../555DD2A9.202@iki.fi/
Also on:    postgresql.org/message-id/555DD2A9.202@iki.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: hlinnaka@iki.fi, pg@heroku.com, tgl@sss.pgh.pa.us, andres@anarazel.de, alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
  In-Reply-To: <555DD2A9.202@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox