Re: Declarative partitioning grammar - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: Declarative partitioning grammar
Date
Msg-id 4787FEDC.9000607@cheapcomplexdevices.com
Whole thread Raw
In response to Declarative partitioning grammar  (Gavin Sherry <swm@alcove.com.au>)
Responses Re: Declarative partitioning grammar  ("Warren Turkal" <turkal@google.com>)
List pgsql-hackers
Gavin Sherry wrote:
> CREATE TABLE is modified to accept a PARTITION BY clause. This clause
> contains one or more partition declarations. The syntax is as follows:
> PARTITION BY {partition_type} (column_name[, column_name...])
> [PARTITIONS number]
>   (
>        partition_declaration[, partition_declaration...]
> 
>   )
> The partition type can be one of HASH, RANGE or LIST.

What would be the drawbacks of CREATE TABLE tablename(...) PARTITION BY function_taking_row_returning_partition_name
instead of the explicit types?


It seems that with my own function I could pretty easily emulate
the HASH,RANGE,or LIST types.   It seems a function returning a
partition name would largely avoid the need for the sub-partition stuff
too -- at least for the cases when the only reason you wanted
sub-partitions was for composite partition support.

I'm not sure if a function would give more flexibility, but
it sure seems it'd be easier for me to remember than the various
PARTITION BY LIST (a) (VALUES ('L') SUBPARTITION BY RANGE (b) (VALUES('x'),VALUES('y')),VALUES ('M') SUBPARTITION BY
RANGE(b) (VALUES('u'),VALUES('t')))
 
or whowever it'd look.




pgsql-hackers by date:

Previous
From: Chris Browne
Date:
Subject: Re: Transaction Snapshot Cloning
Next
From: Mike
Date:
Subject: Re: Declarative partitioning grammar