Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YoBSF-0003v0-B2 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2015 13:58:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YoBSE-0006pu-MG for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2015 13:58:10 +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 1YoBSC-0006nr-UN for pgsql-hackers@postgresql.org; Fri, 01 May 2015 13:58:08 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YoBSA-00024N-5J for pgsql-hackers@postgresql.org; Fri, 01 May 2015 13:58:08 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 7F563860002; Fri, 1 May 2015 15:58:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p54895C9D.dip0.t-ipconnect.de [84.137.92.157]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 0080B860001; Fri, 1 May 2015 15:58:01 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 4C92B100C30; Fri, 1 May 2015 15:58:00 +0200 (CEST) Date: Fri, 1 May 2015 15:58:00 +0200 From: Andres Freund To: Peter Geoghegan Cc: hlinnaka , Jeff Janes , Stephen Frost , Dean Rasheed , Bruce Momjian , Pg Hackers Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 Message-ID: <20150501135800.GC22649@awork2.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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-04-26 18:02:06 -0700, Peter Geoghegan wrote: > Remaining challenges > ================= So I did the executor changes I'd mentioned downthread, and Peter agreed that it'd quite workable. Right now this, besides cleanup, docs and syntax leaves only one real issue I know of. Which is the question what EXCLUDED actually refers to. Consider a table blarg(key int primary key, data text); with a BEFORE INSERT trigger that modifies 'data'. For the statement INSERT INTO blarg(key, data) VALUES(1, 'whatever') ON CONFLICT (key) DO UPDATE SET data = EXCLUDED.data; would you rather have EXCLUDED.data refer to the tuple version from VALUES (or a SELECT or ...) or to version from the BEFORE trigger? To me it seems better to have it refer to version *not* affected by the trigger (which will be called either way). I think it'd be slightly easier to understand and more flexible. But I could live with either decision. This isn't a technical problem, we just have to decide what we want to do. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers