From: | "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net> |
---|---|
To: | vacuum(at)quantentunnel(dot)de, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Automating Partitions in PostgreSQL - Query on syntax |
Date: | 2009-04-21 14:11:54 |
Message-ID: | 1240323114.7167.12.camel@analise3.cresoltec.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Vacuum, I guess you forgot to reply-to-all. ":)
Em Ter, 2009-04-21 às 16:05 +0200, vacuum(at)quantentunnel(dot)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(at)guedesoft(dot)net>
> > An: Kedar Potdar <kedar(dot)potdar(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)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(at)guedesoft(dot)net - skype: guediz
> > http://guedesoft.net - http://planeta.postgresql.org.br
>
--
Dickson S. Guedes
mail/xmpp: guedes(at)guedesoft(dot)net - skype: guediz
http://guedesoft.net - http://planeta.postgresql.org.br
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2009-04-21 14:23:01 | Re: Automating Partitions in PostgreSQL - Query on syntax |
Previous Message | Simon Riggs | 2009-04-21 14:05:51 | Re: New trigger option of pg_standby |