Re: error-free disabling of individual child partition - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: error-free disabling of individual child partition
Date
Msg-id 1148329143.2755.125.camel@localhost.localdomain
Whole thread Raw
In response to error-free disabling of individual child partition tables  ("April Lorenzen" <outboundindex@gmail.com>)
Responses Re: error-free disabling of individual child partition
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Compiling PL/Perl and Pl/Python on x86_64
Next
From: Bruce Momjian
Date:
Subject: Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but THIS