On Mon, 2006-05-22 at 14:25 -0400, April Lorenzen wrote:
> Postgresql partioning makes this all almost possible: the master
> automatically SELECTs from all the child tables - so it automatically
> recoginize the new ones, and no loss when the old ones are dropped.
>
> Just one thing would make it near perfect: if I could keep the master
> from being able to SELECT from the new child table while I'm COPYing
> data into the new child, building the index and vacuuming it - without
> sending an error back to the user who is querying the master table.
There is not currently any way to make an existing table become a child
table of another table. I propose a TODO item to allow this:
ALTER TABLE childN INHERITS ( parent1, ... );
This would only succeed if all of the columns that would have been
inherited from all parent tables already exist with the same name and
datatype, nullability and default values. Additional columns would be
allowed in the child table.
This would also allow you to use CREATE TABLE AS SELECT and then move
that table underneath a parent.
We don't need a disinherit do we?
-- Simon Riggs EnterpriseDB http://www.enterprisedb.com