Re: How to figure out when was a table created - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: How to figure out when was a table created
Date
Msg-id 20031003115405.GA3039@wolff.to
Whole thread Raw
In response to How to figure out when was a table created  ("David B" <postgresql@thegatelys.com>)
List pgsql-sql
On Thu, Oct 02, 2003 at 16:01:16 -0700, David B <postgresql@thegatelys.com> wrote:
> Hi folks,
> 
> I posted this question a few days ago and got no response so I guess it
> cannot be done (surprising!)
> So that leaves me with my business problem.
> 
> We create a table for each days activity.
> After N days (typically 7 days) we can drop the table.
> The table name is not known so cannot force business to make tablename
> something like mydata_MMDDYY
> 
> I'd like to be able to do something like:
>     SELECT tablename
>     FROM   pg_???
>     WHERE  to_char( ???, 'dd/mm/yy' ) = to_char( now() - interval '7 days',
> 'dd/mm/yy' )
> 
> Any suggestions?

You could consider changing the way you do things. You might be able to
accomplish your goal by keeping the data in one table and keeping
partial indexes on the table corresponding to the last seven days.


pgsql-sql by date:

Previous
From: achill@matrix.gatewaynet.com
Date:
Subject: Re: How to figure out when was a table created
Next
From: achill@matrix.gatewaynet.com
Date:
Subject: HeapTuple->t_tableOid==0 after SPI_exec