Re: Docs - Plpgsql trigger example auditing changes into - Mailing list pgsql-patches

From Mark Kirkwood
Subject Re: Docs - Plpgsql trigger example auditing changes into
Date
Msg-id 41B2C066.20807@coretech.co.nz
Whole thread Raw
In response to Re: Docs - Plpgsql trigger example auditing changes into  (David Fetter <david@fetter.org>)
List pgsql-patches
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!

regards

Mark


pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Charset WIN1252
Next
From: "Korea PostgreSQL Users' Group"
Date:
Subject: patch contrib/pgcrypto for win32