| From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> | 
|---|---|
| To: | Melvin Davidson <melvin6925(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: Why is there no object create date is the catalogs? | 
| Date: | 2015-05-12 22:00:54 | 
| Message-ID: | 55527816.7040006@aklaver.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On 05/12/2015 12:51 PM, Melvin Davidson wrote:
>
> Can anyone tell me why there is no "relcreated" column in pg_class to
> track the creation date of an object?
Meant to add to my previous post, back before I 'discovered' version 
control I use to put the creation date in the table COMMENT:
http://www.postgresql.org/docs/9.4/interactive/sql-comment.html
>
> It seems to me it would make sense to have one as it would facilitate
> auditing of when objects are created. In addition, it would also
> facilitate the dropping of objects that have exceeded a certain age.
>
> EG: SELECT 'DELETE TABLE ' || relname || ';'
>        FROM pg_class
>       WHERE relkind = 'r'
>         AND relcreated > current_timestamp - INTERVAL ' 1 year';
>
> Adding that column should be relatively easy and would not break
> backwards compatiblity with previous versions.
> --
> *Melvin Davidson*
-- 
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melvin Davidson | 2015-05-12 22:44:50 | Re: Why is there no object create date is the catalogs? | 
| Previous Message | Adrian Klaver | 2015-05-12 21:53:25 | Re: Why is there no object create date is the catalogs? |