Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VtPmZ-0005Su-2g for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Dec 2013 22:39:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VtPmY-0007Ue-4g for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Dec 2013 22:39:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VtPmW-0007UU-5a for pgsql-bugs@postgresql.org; Wed, 18 Dec 2013 22:39:56 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VtPmT-0001gY-BK for pgsql-bugs@postgresql.org; Wed, 18 Dec 2013 22:39:55 +0000 Received: from intern.anarazel.de (unknown [82.113.121.109]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 5E6644E8001; Wed, 18 Dec 2013 23:39:51 +0100 (CET) Date: Wed, 18 Dec 2013 23:39:44 +0100 From: Andres Freund To: Alvaro Herrera Cc: Tom Lane , Oliver Seemann , pgsql-bugs@postgresql.org Subject: Re: Update with subselect sometimes returns wrong result Message-ID: <20131218223944.GE26481@alap2.anarazel.de> References: <25601.1385834264@sss.pgh.pa.us> <20131130214018.GJ31100@awork2.anarazel.de> <22220.1385880062@sss.pgh.pa.us> <20131201081919.GF18793@alap2.anarazel.de> <20131201114514.GG18793@alap2.anarazel.de> <20131218221343.GG11006@eldon.alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131218221343.GG11006@eldon.alvh.no-ip.org> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2013-12-18 19:13:43 -0300, Alvaro Herrera wrote: > I'm not sure about the added assert that the tuple cannot possibly be > locked. I fear cursors provide strange ways to access at tuples. I don't see how, the EPQ machinery should have ensured we're looking at the most recent version. Also, pretty fundamentally, we have to be the only locker, otherwise the optimization wouldn't be applicable in this way. > In any case I think it's easy to handle the case by doing something like > is_update |= ISUPDATE_from_mxstatus(old_status); > and remove the Assert(). I think I'd rather have the chance to see the pathway to that, than try to handle it. I think we have pretty little chance of doing so correctly if we don't know how it can happen. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs