Re: [HACKERS] Same expression more than once in partition key - Mailing list pgsql-hackers

From Yugo Nagata
Subject Re: [HACKERS] Same expression more than once in partition key
Date
Msg-id 20170624000401.5e5638c4.nagata@sraoss.co.jp
Whole thread Raw
In response to Re: [HACKERS] Same expression more than once in partition key  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 23 Jun 2017 09:54:17 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Yugo Nagata <nagata@sraoss.co.jp> writes:
> > 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
> 
> AFAIK, that's just a simple test for obvious mistakes; it's not a
> property that's essential for correctness.

Thanks. This is what I want to know.

> 
> > However, I can use same expression more than once in partition key.
> 
> ... and so, I can't get excited about extending it to expressions.
> Where would you stop --- for example, are i and (i) equal?  What
> about (i) and (case when true then i else j end)?  In principle,
> the system could recognize both those identities, but it seems
> silly to expend code on it just for nagware purposes.
> 

Agreed.


>             regards, tom lane


-- 
Yugo Nagata <nagata@sraoss.co.jp>



pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Re: [HACKERS] pg_terminate_backend can terminate background workersand autovacuum launchers
Next
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] shift_sjis_2004 related autority files are remaining