Re: Automating Partitions in PostgreSQL - Query on syntax

From: "steven king" <vacuum(at)quantentunnel(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, listas(at)guedesoft(dot)net
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax
Date: 2009-04-21 16:17:43
Message-ID: 20090421161743.311010@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

the idea is, that this statement does not create a new kind of db-object. this "CREATE PARTITIONS" statement should be a meta-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(at)gmail(dot)com>
> An: vacuum(at)quantentunnel(dot)de
> CC: "Dickson S. Guedes" <listas(at)guedesoft(dot)net>, pgsql-hackers(at)postgresql(dot)org
> Betreff: Re: [HACKERS] Automating Partitions in PostgreSQL - Query on syntax

> On Tue, Apr 21, 2009 at 11:13 AM, <vacuum(at)quantentunnel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-04-21 16:19:57 Re: psql with "Function Type" in \df
Previous Message May, Randy 2009-04-21 16:08:40 Re: [ADMIN] License Issue