pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Oliver Seemann <oseemann@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Update with subselect sometimes returns wrong result
Date: Wed, 18 Dec 2013 23:39:44 +0100
Message-ID: <20131218223944.GE26481@alap2.anarazel.de> (raw)
In-Reply-To: <20131218221343.GG11006@eldon.alvh.no-ip.org>
References: <CANCipfpfzoYnOz5jj=UZ70_R=CwDHv36dqWSpwsi27vpm1z5sA@mail.gmail.com>
	<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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (24+ messages)  latest in thread

Message-ID: <20131218223944.GE26481@alap2.anarazel.de>
Permalink:  ../20131218223944.GE26481@alap2.anarazel.de/
Also on:    postgresql.org/message-id/20131218223944.GE26481@alap2.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@2ndquadrant.com, alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, oseemann@gmail.com
  Subject: Re: Update with subselect sometimes returns wrong result
  In-Reply-To: <20131218223944.GE26481@alap2.anarazel.de>
  References: <CANCipfpfzoYnOz5jj=UZ70_R=CwDHv36dqWSpwsi27vpm1z5sA@mail.gmail.com> <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> <20131218223944.GE26481@alap2.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox