Re: Automating Partitions in PostgreSQL - Query on syntax - Mailing list pgsql-hackers

From steven king
Subject Re: Automating Partitions in PostgreSQL - Query on syntax
Date
Msg-id 20090421161743.311010@gmx.net
Whole thread Raw
In response to Re: Automating Partitions in PostgreSQL - Query on syntax  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Automating Partitions in PostgreSQL - Query on syntax  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
the idea is, that this statement does not create a new kind of db-object. this "CREATE PARTITIONS" statement should be
ameta-statement -> "meta" like the serial type.
 

with create paritions you can create all defined tables (maybe by inheritin from <table>) at once. 

but you're right - why this statement should not be able to define some other table-properties (except columns)?!

please notice ... the statement below was only a draft - to show the intention. the major difference is the usage of
conditions.. this could lead into creation of triggers with a lot of PL/pqSQL code or invocations of built-in
functions.

open your mind :)

-------- Original-Nachricht --------
> Datum: Tue, 21 Apr 2009 11:39:37 -0400
> Von: Robert Haas <robertmhaas@gmail.com>
> An: vacuum@quantentunnel.de
> CC: "Dickson S. Guedes" <listas@guedesoft.net>, pgsql-hackers@postgresql.org
> Betreff: Re: [HACKERS] Automating Partitions in PostgreSQL - Query on syntax

> On Tue, Apr 21, 2009 at 11:13 AM,  <vacuum@quantentunnel.de> wrote:
> > oh sorry ..
> >
> > but what I miss in this discussion - where we can define tablespace?
> >
> > CREATE PARTITIONS ON <table> (
> >
> > CASE WHEN <condition> THEN emp_xxx [IN <tablespace>],
> > CASE WHEN <condition> THEN emp_yyy [IN <tablespace>],
> > CASE WHEN <condition> emp_zzz [IN <tablespace>],
> > ELSE emp_default [IN <tablespace>]
> > )
> 
> Oh blech.  That IN <tablespace> syntax is awful.  What about the other
> relevant parameters to CREATE TABLE - where are you going to put
> those?
> 
> WITH (<storage parameter>)
> WITH OIDS
> WITHOUT OIDS
> 
> And what happens when I need to alter a partition after the fact, say
> to move it to a new tablespace, or change the fillfactor?  Since your
> syntax doesn't give names to the partitions, how will I refer to them
> later?
> 
> ...Robert

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!*
http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a


pgsql-hackers by date:

Previous
From: "May, Randy"
Date:
Subject: Re: [ADMIN] License Issue
Next
From: Csaba Nagy
Date:
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax