Re: Advice for generalizing trigger functions
| От | chester c young |
|---|---|
| Тема | Re: Advice for generalizing trigger functions |
| Дата | |
| Msg-id | 918856.33390.qm@web54301.mail.re2.yahoo.com обсуждение исходный текст |
| Ответ на | Advice for generalizing trigger functions (Richard Broersma Jr <rabroersma@yahoo.com>) |
| Ответы |
Re: Advice for generalizing trigger functions
|
| Список | pgsql-sql |
--- Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> I've created quite a few functions that log modifications to various
> history tables. (the history table has the same name as the base
> table but is prefixed by the 'History.' schema.) The only difference
> between functions I can find is the table name.
the problem is that prepared code is referenced by oid, not name. so
any structural references need to by dynamic.
what I do for change log is to have one change log table with table_id
and column_id attributes that refer by to my internal meta_table and
meta_column tables. this always works and is in the end, I have found,
a bit more flexible, allowing you to search for changed columns, for
example.
but I still generate the change triggers. in this case from in my
meta_table and meta_column tables I note which table/columns I want
changes tracked. those can be changed at any time, but the change log
triggers need to be recompiled.
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
В списке pgsql-sql по дате отправления: