Re: 9.0.X FOR UPDATE|SHARE on Sub-Query Causes "cannot extract system attribute from virtual tuple" if Sub-Query Returns Records (BUG)

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: 9.0.X FOR UPDATE|SHARE on Sub-Query Causes "cannot extract system attribute from virtual tuple" if Sub-Query Returns Records (BUG)
Date: 2011-02-10 14:03:23
Message-ID: 00c901cbc92b$486c1290$d94437b0$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom,

From your commit notes:

"This wasn't a problem before 9.0 because we didn't support FOR UPDATE
below the top query level..."

FWIW I had been using a sub-query FOR UPDATE in one of my key queries (one
that was called multiple times per second) and relied upon the FOR UPDATE to
avoid having the same record "dispatched" multiple times. It worked just
fine in 8.2.X and 8.4.X - supported or not.

David J

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Wednesday, February 09, 2011 11:37 PM
To: David Johnston
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] 9.0.X FOR UPDATE|SHARE on Sub-Query Causes "cannot
extract system attribute from virtual tuple" if Sub-Query Returns Records
(BUG)

"David Johnston" <polobo(at)yahoo(dot)com> writes:
> More simply if you run any query of the form:
> SELECT subquerycolumn
> FROM (
> SELECT subquerycolumn FROM table WHERE [condition] FOR UPDATE --
> WHERE is optional but obviously useful; FOR SHARE also causes this
> behavior
> ) intermediate
> The error "cannot extract system attribute from virtual tuple" is
> thrown IIF the sub-query returns one or more records.

Fixed, thanks for the report!

http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=d5478c3391f
8f1a243abbc3d9253aac3d6d3538e

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2011-02-10 14:27:32 Re: Backup/Restore Needed for Upgrade from 9.0beta4?
Previous Message Θάνος Παπαπέτρου 2011-02-10 13:17:34 GUC configuration