Re: [PATCH] Check operator when creating unique index on partition table

2020-04-01 Thread Tom Lane
Guancheng Luo writes: > On Mar 26, 2020, at 01:00, Tom Lane wrote: >> This would reject, for example, a hash index associated with a btree-based >> partition constraint, but I'm not sure we're losing anything much thereby. > There is cases when a BTREE index associated with a HASH partition key,

Re: [PATCH] Check operator when creating unique index on partition table

2020-03-27 Thread Guancheng Luo
> On Mar 26, 2020, at 01:00, Tom Lane wrote: > > Guancheng Luo writes: >> I found that things could go wrong in some cases, when the unique index and >> the partition key use different opclass. > > I agree that this is an oversight, but it seems like your solution is > overcomplicated and pro

Re: [PATCH] Check operator when creating unique index on partition table

2020-03-25 Thread Tom Lane
Guancheng Luo writes: > I found that things could go wrong in some cases, when the unique index and > the partition key use different opclass. I agree that this is an oversight, but it seems like your solution is overcomplicated and probably still too forgiving. Should we not just insist that t

[PATCH] Check operator when creating unique index on partition table

2020-03-25 Thread Guancheng Luo
Hi, I found that things could go wrong in some cases, when the unique index and the partition key use different opclass. For example: ``` CREATE TABLE ptop_test (a int, b int, c int) PARTITION BY LIST (a); CREATE TABLE ptop_test_p1 PARTITION OF ptop_test FOR VALUES IN ('1'); CREATE TABLE ptop_te