Re: table partitioning - Mailing list pgsql-general

From Chris
Subject Re: table partitioning
Date
Msg-id 44EBF116.6020504@gmail.com
Whole thread Raw
In response to Re: table partitioning  (Gene <genekhart@gmail.com>)
List pgsql-general
Hi Gene,

> I'm using a cron job which creates a new partition table every night at
> midnight. After I create the table, I update the rule on the parent
> table so that new records go into the new partition table. Then I update
> the constraints on the tables so that constraint exclusion works. I'm
> doing it this way because you'll find if you have multiple rules on the
> parent table it might not return the proper result for the number of
> affected rows (might not be an issue for you). If you don't need to do
> it like this, just create a script that creates all the tables ahead of
> time. for year-month shouldn't be too many.

Thanks for the info. I think I'll have to use a similar method - it's
for a web-app with quite non-static data.

--
Postgresql & php tutorials
http://www.designmagick.com/

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: unique constraint when updating tables
Next
From: Oliver Jowett
Date:
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured