Re: [HACKERS] SELECT FOR UPDATE in (PL/pgSQL) function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] SELECT FOR UPDATE in (PL/pgSQL) function
Date
Msg-id 9752.933171580@sss.pgh.pa.us
Whole thread Raw
In response to RE: [HACKERS] SELECT FOR UPDATE in (PL/pgSQL) function  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
List pgsql-hackers
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
>> ERROR:  query didn't return correct # of attributes for *internal*

> AFAIC,"SELECT FOR UPDATE" always causes above errors in
> PL/pgSQL functions.

> ORDER/GROUP BY items that are not in the targetlist also cause
> same errors in PL/pgSQL functions.
> In both cases,target entries are added which are not wanted in the
> final projected tuple(SELECT FOR UPDATE adds "ctid" entry).

It sounds like the code that deals with the resulting tuple is not
smart enough to ignore resjunk attributes (or to call ExecProject
if it needs an actual junk-free tuple).  That's probably an easily
fixed bug, but I'm not familiar with the PL code...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
Next
From: Bernard Frankpitt
Date:
Subject: Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple select)