Re: Declarative partitioning grammar
От | Ron Mayer |
---|---|
Тема | Re: Declarative partitioning grammar |
Дата | |
Msg-id | 4787FEDC.9000607@cheapcomplexdevices.com обсуждение исходный текст |
Ответ на | Declarative partitioning grammar (Gavin Sherry <swm@alcove.com.au>) |
Ответы |
Re: Declarative partitioning grammar
|
Список | 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 по дате отправления: