pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Geoff Winkless <pgsqladmin@geoff.dj>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date: Fri, 8 May 2015 17:51:30 +0200
Message-ID: <20150508155130.GN12950@alap3.anarazel.de> (raw)
In-Reply-To: <CAEzk6fcyTdhL_gFVdPxXjmOSV_KWW=BucHXGpQVeYn=NY5=X8w@mail.gmail.com>
References: <CAM3SWZTGE0z5_E8wRi9wt3qgOiMpSwtwr5uDcZDGhRZ1_pz6vg@mail.gmail.com>
	<20150508150340.GJ12950@alap3.anarazel.de>
	<CAEzk6fcyTdhL_gFVdPxXjmOSV_KWW=BucHXGpQVeYn=NY5=X8w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2015-05-08 16:36:07 +0100, Geoff Winkless wrote:
> Omitted only has one m.
> 
> There's an extra space in "error . (See".
> 
> Otherwise it reads fine to me, although I've only skimmed it.

Thanks, I'll push fixes for those.

> I may have misunderstood: there is only one ON CONFLICT action
> allowed?

Yes.

> I thought the previous version suggested multiple possible targets and
> actions, this suggests that while there can be multiple targets the
> action is always the same.

I don't think any version of the patch included that functionality. I
can see it being useful, but it'd make a bunch of things more
complicated, so I doubt we'll get there for 9.5.

> So I thought I could have
> 
> INSERT INTO distributors (did, dname)
>   ON CONFLICT (did) DO UPDATE dname=target.dname
>   ON CONFLICT (dname) DO NOTHING;
> 
> Did I misunderstand?
> 
> Finally there's no
> 
> INSERT INTO distributors (did, dname)
>   SELECT did, dname FROM otherdists
> ON CONFLICT (did) DO NOTHING;
> 
> example (or similar); do we think people will be smart enough to realise
> that's possible without one?​

Hm. I'm tempted to say that the synopis makes that clear enough.  I
personally never check such examples though, so maybe I'm the wrong
person to judge.


-- 
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 (77+ messages)  latest in thread

Message-ID: <20150508155130.GN12950@alap3.anarazel.de>
Permalink:  ../20150508155130.GN12950@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20150508155130.GN12950@alap3.anarazel.de

 · 

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-admin@postgresql.org
  Cc: andres@anarazel.de, pgsqladmin@geoff.dj, pgsql-hackers@postgresql.org
  Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
  In-Reply-To: <20150508155130.GN12950@alap3.anarazel.de>

* 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