Skip site navigation (1) Skip section navigation (2)

table creation/modification datestamp

From: Kevin Neufeld <kneufeld(at)refractions(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: table creation/modification datestamp
Date: 2008-05-26 18:18:37
Message-ID: 483AFEFD.2000504@refractions.net (view raw or flat)
Thread:
Lists: pgsql-admin
As a DBA, it would be extremely useful to know when tables have been 
created or modified.  PostgreSQL doesn't keep track of this, does it?

(Table modification, in my mind, includes INSERTs, DELETEs, UPDATEs, and 
changes performed via ALTER TABLE.  It does not include physical changes 
that may occur on the table due to VAACUMing or CLUSTERing.)

Obviously, I can't use the relfilenode attribute in pg_class to check 
for table modification and look up the file's timestamp, since the OS 
updates the timestamp whenever physical changes occur.  Further, I don't 
think linux even tracks a file's creation timestamp.

The stats collector already tracks when a table was last ANALYZED, it 
would be nice to expand this functionality to include table 
creation/modification times. (Ideally, table timestamp record keeping 
should be persistent over db dumps and restores.)

Cheers,
Kevin

Responses

pgsql-admin by date

Next:From: Andrew SullivanDate: 2008-05-26 20:39:58
Subject: Re: table creation/modification datestamp
Previous:From: Tom LaneDate: 2008-05-25 23:38:10
Subject: Re: v8.2.6->8.2.7 upgrade renamed /var/lib/pgsql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group