Re: parameter in trigger function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: parameter in trigger function
Дата
Msg-id 18605.1060962028@sss.pgh.pa.us
обсуждение исходный текст
Ответ на parameter in trigger function  ("Jules Alberts" <jules.alberts@arbodienst-limburg.nl>)
Список pgsql-general
"Jules Alberts" <jules.alberts@arbodienst-limburg.nl> writes:
> Code like this
> NEW.$1 := lower(NEW.$1)
> won't work, all I get is error messages :-(

Can't do that in plpgsql; it does not like run-time specification of
table or field names.  You could try using EXECUTE but I doubt that
will work either for an assignment to NEW.

I'd suggest using pltcl, which is more amenable to run-time
determination of field names.

> mostly says the opposite. Is this possible at all? How do I read the
> TriggerData structure from whithin a pl/pgsql function?

You are looking for TG_ARGV[], though this is not your biggest
problem...

            regards, tom lane

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

Предыдущее
От: Teodor Sigaev
Дата:
Сообщение: Re: tsearch2 in 7.4beta1 compile problem
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: parameter in trigger function