Re: INSERT ... ON CONFLICT syntax issues - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: INSERT ... ON CONFLICT syntax issues
Date
Msg-id 20150427172005.GA21038@momjian.us
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT syntax issues  (Stephen Frost <sfrost@snowman.net>)
Responses Re: INSERT ... ON CONFLICT syntax issues
List pgsql-hackers
On Sun, Apr 26, 2015 at 09:34:12AM -0400, Stephen Frost wrote:
> * Heikki Linnakangas (hlinnaka@iki.fi) wrote:
> > On 04/25/2015 12:01 PM, Andres Freund wrote:
> > >INSERT ... ON CONFLICT (cola, colb [WHERE predicate_for_partial]) UPDATE|IGNORE
> > >
> > >My problem with the WHERE being inside the parens in the above is that
> > >it's
> > >a) different from CREATE INDEX
> > >b) unclear whether the WHERE belongs to colb or the whole index
> > >    expression. The equivalent for aggregates, which I bet is going to be
> > >    used less often, caused a fair amount of confusing.
> > >
> > >That's why I wanted the WHERE outside the (), which requires either
> > >adding DO between the index inference clause, and the action, to avoid
> > >ambiguities in the grammar.
> > 
> > Yeah, having the WHERE outside the parens seems much nicer. What is
> > the ambiguity?
> 
> I like having it outside the parens also.

Agreed, and I like the DO [ UPDATE | NOTHING ] too.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



pgsql-hackers by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: PL/pgSQL, RAISE and error context
Next
From: Stephen Frost
Date:
Subject: Re: GSSAPI, SSPI - include_realm default