Re: Partitioning WIP patch (was: Partitioning: issues/ideas)

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Partitioning WIP patch (was: Partitioning: issues/ideas)
Date: 2015-02-24 16:13:05
Message-ID: CADkLM=dnAB=WSX_8ZKx7TAgmacC6tBNqrzmMfd06vRDAGNuANw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think it's confusing to use BETWEEN to mean [low,high) when it already
means [low,high] in WHERE clauses.

Why not leverage range notation instead?

CREATE TABLE parent_monthly_xxxxx_201401 PARTITION OF
parent_monthly_xxxxx FOR VALUES IN RANGE '[2014-04-01,2014-05-01)'

"IN RANGE" could easily be "WITHIN RANGE" or "WITHIN" or something else.

Clearly, this example above assumes that the partitioning is on a single
column.

For partitioning on a set of columns you're essentially creating a custom
composite type with major-minor collation, could that custom type be
created at table creation time? Could an existing composite type be
declared as the partition key?

CREATE TYPE year_month( year int, month int );

(CREATE OPERATOR... for < = > )

CREATE TABLE parent_monthly(year int, month int, day int) PARTITION BY
RANGE ON year_month(year, month);

On Tue, Feb 24, 2015 at 5:53 AM, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp
> wrote:

> On 24-02-2015 PM 05:13, Amit Langote wrote:
> > Additionally, a partition can itself be further partitioned (though I
> > have not worked on the implementation details of multilevel partitioning
> > yet):
> >
> > CREATE TABLE table_name PARTITION OF parent_name PARTITION BY
> > {RANGE|LIST} ON(key_columns) FOR VALUES values_clause;
>
> One more blunder, supposed to be:
>
> CREATE TABLE table_name PARTITION OF parent_name FOR VALUES
> values_clause PARTITION BY {RANGE|LIST} ON(key_columns);
>
> Thanks,
> Amit
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-02-24 16:19:12 Re: Primary not sending to synchronous standby
Previous Message Ryan Pedela 2015-02-24 15:49:37 Re: deparsing utility commands