Feature / Enhancement request.

From: Melvin Davidson <melvin(dot)davidson(at)rackspace(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Feature / Enhancement request.
Date: 2009-08-25 16:18:09
Message-ID: 27427_1251217095_n7PGIANC003562_2594739A5DA9FB439DA88E61EA12430114420F052A@DFW1MXM01.RACKSPACE.CORP
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It would really be nice if pg_class were altered to add two new columns: relcreatedat & relmoddat.
Both would be of type timestamp. relcreatedat would contain the timestamp the object was created.
Likewise, relmoddat would contain the last timestamp the object was altered / modified.

This would be very useful for user tables that are meant to exist for only a specific length of time. eg: 1 month.
Then a simple:
SELECT relname
FROM pg_class
WHERE current_timestamp::date - relcreatedat::date > 30
AND relname LIKE 'tmp_%';

Would show possible expired tables.

Likewise, relmoddat would be useful for determining when someone made changes to a table, index, view, etc.

Melvin Davidson - DBA

Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse(at)rackspace(dot)com, and delete the original message.
Your cooperation is appreciated.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rob Wultsch 2009-08-25 17:10:34 SET syntax in INSERT
Previous Message Kevin Grittner 2009-08-25 14:39:29 Re: Bug in date arithmetic