Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created
Date: 2016-04-21 07:11:23
Message-ID: 20160421071123.GE21533@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 20, 2016 at 07:09:24PM -0400, Melvin Davidson wrote:

> There is also the situation of tables with limitited use. EG:
> history_yyyymm, in which case it would facilitate dropping of tables that
> are no longer needed after x amount of time.

select * from pg_class where to_timestamp(substring(relname from 9), 'YYYYMM') CONDITION;

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ihnat Peter | TSS Group a.s. 2016-04-21 07:51:40 Background worker with Listen
Previous Message Karsten Hilbert 2016-04-21 07:04:08 Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created