Trigger question

Поиск
Список
Период
Сортировка
От Pat Marchant
Тема Trigger question
Дата
Msg-id 20011220214817.GA17920@lvcablemodem.com
обсуждение исходный текст
Ответы Re: Trigger question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
I want to create a generic update trigger for all
tables in a DB using plpgsql. I'm thinking that having
one big trigger is more efficient than having a table
fire many triggers for each update.

To do this I need to know if an attribute exists in
the current table. For example, most of my tables
have an updated (datetime) field. I'd like to do
something like:

if (AttributeExists(new.updated))
   { new.updated = 'now'::datetime;}


I'd like to be able to use this trigger on
all tables - even if they don't have an
'updated' attribute.

Is there a way to do this?

-Pat Marchant

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

Предыдущее
От: Stephen Ingram
Дата:
Сообщение: Using a tablename as a parameter to a function.
Следующее
От: Philip Hallstrom
Дата:
Сообщение: Re: FW: Random Selection from TABLE