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.