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

From Robert Haas
Subject Re: Automating Partitions in PostgreSQL - Query on syntax
Date
Msg-id 603c8f070904211036h148c4d35i59b1025268a7865e@mail.gmail.com
Whole thread Raw
In response to Re: Automating Partitions in PostgreSQL - Query on syntax  ("steven king" <vacuum@quantentunnel.de>)
Responses Re: Automating Partitions in PostgreSQL - Query on syntax  ("steven king" <vacuum@quantentunnel.de>)
List pgsql-hackers
On Tue, Apr 21, 2009 at 12:35 PM, steven king <vacuum@quantentunnel.de> wrote:
> why a partition-key cannot be a complex expression?
>
> like this:
>
> SWITCH <expression>
> CASE <key_value> TABLE <table> [IN <table_space>]
> CASE <key_value> TABLE <table> [IN <table_space>]
> CASE <key_value> TABLE <table> [IN <table_space>]
> DEFAULT <table> [IN <table_space>]
>
> that is generic

Rather than SWITCH <expression> CASE <value> ... you probably would
want to reuse the existing PostgreSQL syntax of CASE <expression> WHEN
<value>...

But see my previous email for concerns about the performance of this
approach when the number of partitions is large.

...Robert


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: psql with "Function Type" in \df
Next
From: Jaime Casanova
Date:
Subject: per db collate syntax