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

From vacuum@quantentunnel.de
Subject Re: Automating Partitions in PostgreSQL - Query on syntax
Date
Msg-id 20090421151308.191260@gmx.net
Whole thread Raw
In response to Re: Automating Partitions in PostgreSQL - Query on syntax  ("Dickson S. Guedes" <listas@guedesoft.net>)
Responses Re: Automating Partitions in PostgreSQL - Query on syntax  (Greg Stark <stark@enterprisedb.com>)
Re: Automating Partitions in PostgreSQL - Query on syntax  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
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>]
)

-------- Original-Nachricht --------
> Datum: Tue, 21 Apr 2009 11:11:54 -0300
> Von: "Dickson S. Guedes" <listas@guedesoft.net>
> An: vacuum@quantentunnel.de, pgsql-hackers@postgresql.org
> Betreff: Re: [HACKERS] Automating Partitions in PostgreSQL - Query on syntax

> Vacuum, I guess you forgot to reply-to-all. ":)
> 
> Em Ter, 2009-04-21 às 16:05 +0200, vacuum@quantentunnel.de escreveu:
> > why not partitions by "conditions"? 
> > 
> > you can do that in similar way how "case when then " works .. 
> > 
> > CREATE PARTITIONS ON <table> 
> >   SWITCH <any expression>
> >   CASE <value> THEN <part_1>,
> >   CASE <value> THEN <part_2>,
> >   CASE <value> THEN <part_3>,
> >   DEFAULT emp_default;
> > 
> > with a difference to case: <value> may not be a boolean expression
> > 
> > or you can do it as CASE works
> > 
> > forinstance:
> > 
> > CREATE PARTITIONS ON emp (
> >   CASE WHEN <value> THEN emp_xxx,
> >   CASE WHEN <value> THEN emp_yyy,
> >   CASE WHEN <value> emp_zzz,
> >   ELSE emp_default
> >   END CASE;
> > );
> > 
> > -------- Original-Nachricht --------
> > > Datum: Tue, 21 Apr 2009 10:46:41 -0300
> > > Von: "Dickson S. Guedes" <listas@guedesoft.net>
> > > An: Kedar Potdar <kedar.potdar@gmail.com>,
> pgsql-hackers@postgresql.org
> > > Betreff: Re: [HACKERS] Automating Partitions in PostgreSQL - Query on
> syntax
> > 
> > > Em Ter, 2009-04-21 às 17:20 +0530, Kedar Potdar escreveu:
> > > > Hi , 
> > > > 
> > > > We are working on a patch to automate partitioning in PostgreSQL. 
> > > 
> > > Nice. ":)
> > > 
> > > > For Range partitions, we have proposed the syntax which is as
> > > > follows  
> > > > 
> > > > (...)
> > > > PARTITION BY RANGE (emp_id)
> > > > (
> > > > emp_500 (START 1 END 500),
> > > > emp_1500 (START 500 END 1500),
> > > > emp_4000 (START 1520 END 4000)
> > > > );
> > > 
> > > What if I need more columns to set the partitions?
> > > 
> > > 
> > > []s
> > > -- 
> > > Dickson S. Guedes 
> > > mail/xmpp: guedes@guedesoft.net - skype: guediz
> > > http://guedesoft.net - http://planeta.postgresql.org.br
> > 
> -- 
> Dickson S. Guedes 
> mail/xmpp: guedes@guedesoft.net - skype: guediz
> http://guedesoft.net - http://planeta.postgresql.org.br

-- 
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: Simon Riggs
Date:
Subject: Re: New trigger option of pg_standby
Next
From: Greg Stark
Date:
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax