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

From Heikki Linnakangas
Subject Re: INSERT ... ON CONFLICT syntax issues
Date
Msg-id 554B6566.70206@iki.fi
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT syntax issues  (Andres Freund <andres@anarazel.de>)
Responses Re: INSERT ... ON CONFLICT syntax issues  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 05/07/2015 12:01 AM, Andres Freund wrote:
> 6. The tablename and EXCLUDED? Possibility with the ability to specify
>     an AS for INSERT INTO foo AS whatever?

If we don't allow "AS whatever", and you create a table called 
"excluded", you're stuck with the ambiguity in the DO UPDATE statement 
as you can't alias either one. So we have to add support for "INSERT 
INTO foo AS whatever", if we go with <tablename> and EXCLUDED.

Does anyone see a problem with "INSERT INTO foo AS whatever"? It seems 
pretty straightforward to implement.

If we don't use <tablename> and go back to TARGET/EXCLUDED or whatever 
we call them, they must only be visible to the UPDATE statement, not 
RETURNING. Otherwise we're back to square one.

- Heikki




pgsql-hackers by date:

Previous
From: Sawada Masahiko
Date:
Subject: Proposal : REINDEX xxx VERBOSE
Next
From: Magnus Hagander
Date:
Subject: Re: Re: [BUGS] BUG #11805: Missing SetServiceStatus call during service shutdown in pg_ctl (Windows only)