Re: looping on NEW and OLD in a trigger

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: looping on NEW and OLD in a trigger
Дата
Msg-id 19546.1282840163@sss.pgh.pa.us
обсуждение исходный текст
Ответ на looping on NEW and OLD in a trigger  ("Michael P. Soulier" <michael_soulier@mitel.com>)
Ответы Re: looping on NEW and OLD in a trigger  ("Michael P. Soulier" <michael_soulier@mitel.com>)
Список pgsql-general
"Michael P. Soulier" <michael_soulier@mitel.com> writes:
> I'm very new to writing postgres procedures, and I'm trying to loop over
> the fields in the NEW and OLD variables available in an after trigger,
> and I can't quite get the syntax correct.

If you're trying to do this in plpgsql, the answer is you can't.
plpgsql doesn't support dynamic field references, which is what you'd
need for what (I think) you're trying to do.

You can do it in pltcl or plperl, and probably also plpython though
I don't know enough python to be sure.

            regards, tom lane

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

Предыдущее
От: "Michael P. Soulier"
Дата:
Сообщение: looping on NEW and OLD in a trigger
Следующее
От: "Michael P. Soulier"
Дата:
Сообщение: Re: looping on NEW and OLD in a trigger