Folks,
I've been looking into ways to have a better idea--automatically--of
what's been going on in a database from a DDL level, and here's what
I've come up with so far. I'd much appreciate hearing suggestions
and/or brickbats on this.
The idea is to make a new table in pg_catalog called pg_ddl. This
would have the structure
CREATE TABLE pg_catalog.pg_ddl ( objoid oid NOT NULL, -- object's oid objddl TEXT NOT NULL, -- raw text of DDL
objmodifiedTIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP -- pretty obvious
;)
);
For any given object, it would contain all the DDL successfully
executed + a timestamp, so it would be possible to get a history on
any or all DB objects (modulo DROP/CREATE). How hard would it be to
get the raw text of the DDL and hold onto it until the DDL either
succeeds or fails?
Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 415 235 3778
Remember to vote!