Re: Same expression more than once in partition key

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Same expression more than once in partition key
Date: 2017-06-23 07:09:16
Message-ID: 20170623160916.5badfdbd.nagata@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 23 Jun 2017 15:57:54 +0900
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:

> Hi,
>
> When we create a range partitioned table, we cannot use
> a column more than once in the partition key.
>
> postgres=# create table t (i int) partition by range(i,i);
> ERROR: column "i" appears more than once in partition key
>
> However, I can use same expression more than once in partition key.
>
> postgres=# create table t (i int) partition by range((i),(i));
> CREATE TABLE
>
> Although this can be blocked by the attached parch, for example,
> the following is still possible.

I forgot to attach it.

>
> postgres=# create table t (i int) partition by range((i),i);
> CREATE TABLE
>
> Can these definition be a problem in the internal of partitioning?
> If not, we might not need to check column that apears more than once
> in the partition key.
>
> Regards,
>
>
>
> --
> Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
range_partition_same_expression.patch text/x-diff 1.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2017-06-23 07:18:41 Re: Small bug in replication lag tracking
Previous Message Ashutosh Bapat 2017-06-23 07:01:04 Re: Multi column range partition table