Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YoBoY-0005Cb-1D for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2015 14:21:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YoBoX-00034g-Ck for pgsql-hackers@arkaria.postgresql.org; Fri, 01 May 2015 14:21:13 +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 1YoBoW-00034a-LU for pgsql-hackers@postgresql.org; Fri, 01 May 2015 14:21:12 +0000 Received: from mail-wg0-f52.google.com ([74.125.82.52]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YoBoT-0002Z9-NA for pgsql-hackers@postgresql.org; Fri, 01 May 2015 14:21:12 +0000 Received: by wgen6 with SMTP id n6so92040722wge.3 for ; Fri, 01 May 2015 07:21:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Wzr3Z3gVXEm067NSIHFeVgdbQTsJBnEZlfr9dC10bC0=; b=REFHV7f0Obmp/uH93e/kCG9SEef78/xTH1y9GyxHXU8lgzVSN3v5+igXsWo/xDHiNd rmWLdOYByyRp+hbGSmOl/m6uQa+vaeZkmsLZ5puS+LV40MA6iRTogVF19b/7s2kHTqP1 h9zcJVNwXFPMZgQLXm4ecMa9H+BKGvgW3v/HaInFHDkJVB2GDLINTq133mdqNcFe3fjI +Kh+0OedFcXC8ZkTV//VbxDRBNNRUM2lhVNW4uiTeyF+z8G2u04H7Wi4VnpV6RORfho+ iMGazopVuBTL8G7tKQkB13voMXbWMB6xQpYgxHEyTrgzPz/KSCLvrbGf+0LLk/Xcx05f eUBg== X-Gm-Message-State: ALoCoQlXKuep5uhb+PYQPmUF10ZfYlb5riONh1aAQB3rG/9weNzgH8eNTF8D6qb++bR5zrS+PFAiTD577tUa56sVhYAV8SXNEXre7vPd6Kyz9dZcQ1gZYQbleJ2Kj/8Q0z0Xtll17jToCfvEHHI/pBWBxL8lCn2xm7htuv7uhv3S5ePGTjzNBFo= X-Received: by 10.194.185.40 with SMTP id ez8mr18028425wjc.96.1430490067766; Fri, 01 May 2015 07:21:07 -0700 (PDT) Received: from [192.168.1.146] (ip-89-176-99-192.net.upcbroadband.cz. [89.176.99.192]) by mx.google.com with ESMTPSA id w5sm6926994wiz.11.2015.05.01.07.21.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 May 2015 07:21:06 -0700 (PDT) Message-ID: <55438BD1.1020102@2ndquadrant.com> Date: Fri, 01 May 2015 16:21:05 +0200 From: Petr Jelinek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Andres Freund , Robert Haas CC: Peter Geoghegan , hlinnaka , Jeff Janes , Stephen Frost , Dean Rasheed , Bruce Momjian , Pg Hackers Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 References: <20150501135800.GC22649@awork2.anarazel.de> <20150501141052.GE22649@awork2.anarazel.de> In-Reply-To: <20150501141052.GE22649@awork2.anarazel.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.1 (-) 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 01/05/15 16:10, Andres Freund wrote: > On 2015-05-01 10:06:42 -0400, Robert Haas wrote: >> On Fri, May 1, 2015 at 9:58 AM, Andres Freund wrote: >>> would you rather have EXCLUDED.data refer to the tuple version from >>> VALUES (or a SELECT or ...) or to version from the BEFORE trigger? >> >> I think it would be completely shocking if it didn't refer to the >> version returned by the BEFORE trigger. My interpretation of the >> semantics of BEFORE triggers is that, once the trigger has fired and >> returned a new tuple, things should proceed just as if that new tuple >> were the one originally provided by the user. > > Well, it's a BEFORE INSERT trigger, not a BEFORE UPDATE, that's why I'm > not so sure that argument applies. > > Peter also leaned in "your" direction and you apparently have a strong > opinion on it... So I guess that'll be it unless somebody else weighs > in. > FWIW I am also leaning towards what Robert says. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers