Re: BUG #5798: Some weird error with pl/pgsql procedure

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5798: Some weird error with pl/pgsql procedure
Дата
Msg-id 10910.1298236066@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #5798: Some weird error with pl/pgsql procedure  (Maxim Boguk <maxim.boguk@gmail.com>)
Ответы Re: BUG #5798: Some weird error with pl/pgsql procedure
Список pgsql-bugs
Maxim Boguk <maxim.boguk@gmail.com> writes:
> I tracked virtual tuple from heaptuple.c::slot_getattr down to
> execMain.c::ExecUpdate and I think somewhere in this way virtual tuple
> should be need to be "materialized" into physical tuple.

That happens at the top of ExecUpdate:

    /*
     * get the heap tuple out of the tuple table slot, making sure we have a
     * writable copy
     */
    tuple = ExecMaterializeSlot(slot);

I don't see any code path there that could re-virtualize the slot.

Do you have any triggers or constraints on the target table?  Because
those are about the only things that influence this code path at all...

> Again I not sure but ExecProcessReturning function seems good candidate to
> perform tuple materialization.

If ExecProcessReturning were given a virtual slot, materializing it
would do no good at all for this problem, because the system columns in
the result would be garbage.  It has to receive an already materialized
slot that contains the right information beforehand.  The only reason
that retrieving ctid can work at all is that when heap_update is called,
"tuple" is pointing at the slot's contained tuple and so setting
tuple->t_self changes the contents of the slot.  That whole function is
completely dependent on the slot contents being physical not virtual,
and I don't see anything there that would break it.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Maxim Boguk
Дата:
Сообщение: Re: BUG #5798: Some weird error with pl/pgsql procedure
Следующее
От: "Christopher Head"
Дата:
Сообщение: BUG #5895: Ability to match more than just CN in client certificate