Re: Auto creation of Partitions - Mailing list pgsql-hackers

From Shane Ambler
Subject Re: Auto creation of Partitions
Date
Msg-id 45F087A6.3010107@Sheeky.Biz
Whole thread Raw
In response to Re: Auto creation of Partitions  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: Auto creation of Partitions
List pgsql-hackers
Jim C. Nasby wrote:
> On Thu, Mar 08, 2007 at 01:52:27PM +0530, NikhilS wrote:
>>> I think it'd be great to make adding and removing partitions as
>>> simple as ALTER TABLE. I don't think that DELETE should be the
>>> mechanism to drop a partition, though. Again, DML statements
>>> shouldn't be performing DDL.
>>
>> Since partition is inheritance-based, a simple DROP or  "NO INHERIT" will do
>> the job to deal with the partition. Do we want to reinvent additional syntax
>> when these are around and are documented?
> 
> Well, if the syntax for adding a new partition eventually ends up as
> ALTER TABLE ADD PARTITION, then it would make more sense that you remove
> a partition via ALTER TABLE DROP PARTITION.

This follows on from the suggestion I made - taken along the lines of 
the subject "auto creation of partitions" where I suggested the syntax 
of partition check(month of mydatecol) and have a new partition created 
as data was entered. With this scenario dropping the partition when it 
was empty would complement the creation of a new partition as needed.

Given that there seems to be no real support of going with "auto 
maintenance" were new partitions are added as needed, then the auto 
dropping of empty partitions would also not apply.

Leaving us with only specific add partition / drop partition commands.
And have the parent table pick up rows not matching any partition check 
criteria.


-- 

Shane Ambler
pgSQL@Sheeky.Biz

Get Sheeky @ http://Sheeky.Biz


pgsql-hackers by date:

Previous
From: "Hideyuki Kawashima"
Date:
Subject: Re: Acclerating INSERT/UPDATE using UPS
Next
From: Neil Conway
Date:
Subject: Re: Estimating seq_page_fetch and random_page_fetch