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

From Dickson S. Guedes
Subject Re: Automating Partitions in PostgreSQL - Query on syntax
Date
Msg-id 1240323114.7167.12.camel@analise3.cresoltec.com.br
Whole thread Raw
In response to Automating Partitions in PostgreSQL - Query on syntax  (Kedar Potdar <kedar.potdar@gmail.com>)
Responses Re: Automating Partitions in PostgreSQL - Query on syntax  (vacuum@quantentunnel.de)
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Kedar Potdar
Date:
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax
Next
From: Pavel Stehule
Date:
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax