Re: Dyamic updates of NEW with pl/pgsql

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Dyamic updates of NEW with pl/pgsql
Дата
Msg-id b42b73151003112009t6b92bbecka0ea7237550ffcd0@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Dyamic updates of NEW with pl/pgsql  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Dyamic updates of NEW with pl/pgsql  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
On Wed, Mar 10, 2010 at 7:50 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
>>> 2010/3/9 strk <strk@keybit.net>:
>>>> How can a pl/pgsql trigger change the
>>>> values of dynamic fields in NEW record ?
>>>>
>>>> By "dynamic" I mean that the field name
>>>> is a variable in the trigger context.
>>>>
>>>> I've been told it's easy to do with pl/perl but
>>>> I'd like to delive a pl/pgsql solution to have
>>>> less dependencies.
>
> Using an hstore in 9.0 it's not too bad, Try something like:
>

Agree 100%.  The new hstore going to completely nail a broad class of
issues that have historically been awkward in plpgsql functions.
(small aside: the other biggie would be able to push a composite type
in to an update statement...something like 'update foo set foo =
new').  This is really great...some variant of this question is
continually asked it seems.

merlin


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Warning about invalid .pgpass passwords
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Dyamic updates of NEW with pl/pgsql