Re: proposal: plpgsql - iteration over fields of rec or row variable

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: proposal: plpgsql - iteration over fields of rec or row variable
Дата
Msg-id 1289332764-sup-8121@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: proposal: plpgsql - iteration over fields of rec or row variable  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Excerpts from Merlin Moncure's message of mar nov 09 16:41:32 -0300 2010:

> The only exception I see is in trigger functions.  If the trigger
> function plan is specific to the firing trigger, new and old are
> defined at plan time, so something like:
> 
>   new{TG_FIELDNAMES[1]} = 5; -- is ok (at least IMO), since
> TG_FIELDNAMES is immutable (at least to the plan).
> 
> I don't honestly know if it's worth it -- the main case is performance
> (plus Pavel's secondary argument of loss of type information).
> Something like this would address an awful lot of gripes about trigger
> functions though.

I think the interesting bit (wrt the examples I've seen, that is) would
be to be able to use the TG_ARGS array as the element specifier.  Not
sure if this is any different from your example.  It's been some time
since I've been near this though, so maybe what I wanted is now possible
with USING tricks.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: CREATE CONSTRAINT TRIGGER
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Protecting against unexpected zero-pages: proposal