Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YqkYv-00023M-O4 for pgsql-hackers@arkaria.postgresql.org; Fri, 08 May 2015 15:51:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YqkYv-0005PJ-20 for pgsql-hackers@arkaria.postgresql.org; Fri, 08 May 2015 15:51:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YqkYu-0005Op-3B for pgsql-hackers@postgresql.org; Fri, 08 May 2015 15:51:40 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YqkYn-0000Kl-F2 for pgsql-hackers@postgresql.org; Fri, 08 May 2015 15:51:39 +0000 Received: from intern.anarazel.de (unknown [184.23.178.130]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 453A2860001; Fri, 8 May 2015 17:51:32 +0200 (CEST) Date: Fri, 8 May 2015 17:51:30 +0200 From: Andres Freund To: Geoff Winkless Cc: Pg Hackers Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 Message-ID: <20150508155130.GN12950@alap3.anarazel.de> References: <20150508150340.GJ12950@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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