Re: [HACKERS] Same expression more than once in partition key

2017-06-27 Thread Robert Haas
On Fri, Jun 23, 2017 at 4:04 PM, Tom Lane wrote: > Peter Eisentraut writes: >> We also allow the same column more than once in an index. We probably >> don't have to be more strict here. > > There actually are valid uses for the same column

Re: [HACKERS] Same expression more than once in partition key

2017-06-25 Thread Amit Langote
On 2017/06/24 5:04, Tom Lane wrote: > Peter Eisentraut writes: >> We also allow the same column more than once in an index. We probably >> don't have to be more strict here. > > There actually are valid uses for the same column more than once in > an index, eg

Re: [HACKERS] Same expression more than once in partition key

2017-06-23 Thread Tom Lane
Peter Eisentraut writes: > We also allow the same column more than once in an index. We probably > don't have to be more strict here. There actually are valid uses for the same column more than once in an index, eg if you use a different operator class for each

Re: [HACKERS] Same expression more than once in partition key

2017-06-23 Thread Peter Eisentraut
On 6/23/17 09:54, Tom Lane wrote: >> 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)?

Re: [HACKERS] Same expression more than once in partition key

2017-06-23 Thread Yugo Nagata
On Fri, 23 Jun 2017 09:54:17 -0400 Tom Lane wrote: > Yugo Nagata 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); > >

Re: [HACKERS] Same expression more than once in partition key

2017-06-23 Thread Tom Lane
Yugo Nagata 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

Re: [HACKERS] Same expression more than once in partition key

2017-06-23 Thread Yugo Nagata
On Fri, 23 Jun 2017 15:57:54 +0900 Yugo Nagata 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

[HACKERS] Same expression more than once in partition key

2017-06-23 Thread Yugo Nagata
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.