Re: FW: indirect dereferencing a field in a record using plpgsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FW: indirect dereferencing a field in a record using plpgsql
Дата
Msg-id 11716.1063031513@sss.pgh.pa.us
обсуждение исходный текст
Ответ на FW: indirect dereferencing a field in a record using plpgsql  ("Conrad Vermeulen" <conrad@fastforward.za.net>)
Список pgsql-hackers
"Conrad Vermeulen" <conrad@fastforward.za.net> writes:
> Possibly my quick hack may not work if the parser
> predetermines the type  as the functionality required would only really be
> able to determine the type at time of execution.

The problem is that the first time through, the execution plan for the
command or expression is generated and cached.  So you can't change the
type of the field dereference later.

plpgsql is really not designed for this sort of thing; it's designed to
be fast with predictable data types.  Use pltcl or plperl instead.
There's a reason why we support multiple PLs ;-)

I agree that it would be good to fix EXECUTE so that one could refer to
NEW or OLD in the constructed query (and other plpgsql variables too).
I believe this would take a rather serious overhaul of plpgsql's parser
though ...
        regards, tom lane


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

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: plpgsql debugging
Следующее
От: "Gaetano Mendola"
Дата:
Сообщение: Re: mcxt.c