Search Postgresql Archives

Adding audit trail fields and triggers to all tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I need to add the following fields to all tables to existing 8.1 database:


created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,

createdby text DEFAULT CURRENT_USER,

updated timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,

updatedby text   -- current_user who last updates this record


I need also to add triggers so that updated and updatedby fields ae
automatically set when record is changed.


Where to find script which implements this ?


Andrus.







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux