David Fetter wrote:

It occurs to me that this might be a place to demo table inheritance
too, to ease automating the creation, etc. of the auditing
infrastructure :)

It certainly makes the creation of the audit table painless :

CREATE TABLE emp_audit(
   operation         char(1)   NOT NULL,
   stamp             timestamp NOT NULL,
   userid            text      NOT NULL
) INHERITS (emp);

However SELECT FROM emp will return rows from emp_audit as well! (unless
we always use FROM ONLY or set SQL_INHERITANCE=false). This seem likely
to confuse things!



---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?


Reply via email to