Re: Keeping creation time of objects - Mailing list pgsql-hackers

From daveg
Subject Re: Keeping creation time of objects
Date
Msg-id 20080909200825.GA5866@sonic.net
Whole thread Raw
In response to Re: Keeping creation time of objects  (Hannu Krosing <hannu@2ndQuadrant.com>)
Responses Re: Keeping creation time of objects  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Tue, Sep 09, 2008 at 11:03:56PM +0300, Hannu Krosing wrote:
> On Tue, 2008-09-09 at 12:40 -0700, daveg wrote:
> 
> > I'd be very interested in seeing a last schema modification time for pg_class
> > objects. I don't care about it being preserved over dump and restore as my
> > use case is more to find out when a table was created with a view to finding
> > out if it is still needed.
> 
> Isn't it easier to find out if it is still needed by looking if it is
> still used, say from pg_stat_user_tables ?

Except that pg_dump will access it and make it look used. Also, this does
not work for functions, views etc.

It seems to me to be pretty simple to put an abstime or timestamp column
on the major catalog tables and update it when the row is updated. A mod
time is more useful probably than a create time.

-dg

-- 
David Gould       daveg@sonic.net      510 536 1443    510 282 0869
If simplicity worked, the world would be overrun with insects.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch
Next
From: Andrew Dunstan
Date:
Subject: Re: Keeping creation time of objects