Re: How to figure out when was a table created

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: David B <postgresql(at)thegatelys(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to figure out when was a table created
Date: 2003-10-03 11:54:05
Message-ID: 20031003115405.GA3039@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Oct 02, 2003 at 16:01:16 -0700,
David B <postgresql(at)thegatelys(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message btober 2003-10-03 12:12:29 Re: How to figure out when was a table created
Previous Message Jan Pips 2003-10-03 07:23:46 Data type conversion