Re: cursors FOR UPDATE don't return most recent row

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: cursors FOR UPDATE don't return most recent row
Date: 2012-01-30 01:07:06
Message-ID: 1327885054-sup-7077@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Excerpts from Tom Lane's message of sáb ene 28 01:35:33 -0300 2012:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> > I expected the FETCH to return one row, with the latest data, i.e.
> > (1, 3), but instead it's returning empty.
>
> This is the same thing I was complaining about in the bug #6123 thread,
> http://archives.postgresql.org/message-id/9698.1327266271@sss.pgh.pa.us
>
> It looks a bit ticklish to fix.

Hm. Okay, I hadn't read that.

In my FOR KEY SHARE patch I have added a heap_lock_updated_tuple that
makes heap_lock_tuple follow the update chain forward when the tuple
being locked is being updated by a concurrent transaction. I haven't
traced through FETCH to see if it makes sense to apply some of that to
it.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-01-30 01:13:43 Re: cursors FOR UPDATE don't return most recent row
Previous Message Jeff Janes 2012-01-29 23:29:42 Re: Vacuum rate limit in KBps