Re: Automating Partitions in PostgreSQL - Query on syntax

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: steven king <vacuum(at)quantentunnel(dot)de>
Cc: Greg Stark <stark(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, listas(at)guedesoft(dot)net
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax
Date: 2009-04-21 17:36:19
Message-ID: 603c8f070904211036h148c4d35i59b1025268a7865e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 21, 2009 at 12:35 PM, steven king <vacuum(at)quantentunnel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2009-04-21 17:37:40 per db collate syntax
Previous Message Robert Haas 2009-04-21 17:33:28 Re: Automating Partitions in PostgreSQL - Query on syntax