Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJiUJ-0003hk-2R for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2020 18:53:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJiUH-0008BT-OO for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2020 18:53:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJiUH-00086o-C7 for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2020 18:53:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJiUB-0007cJ-3b for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2020 18:53:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 031Ir9GW020083; Wed, 1 Apr 2020 14:53:09 -0400 From: Tom Lane To: Guancheng Luo cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Check operator when creating unique index on partition table In-reply-to: References: <4731.1585155636@sss.pgh.pa.us> Comments: In-reply-to Guancheng Luo message dated "Sat, 28 Mar 2020 11:28:41 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20081.1585767189.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 01 Apr 2020 14:53:09 -0400 Message-ID: <20082.1585767189@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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-ba= sed >> partition constraint, but I'm not sure we're losing anything much there= by. > There is cases when a BTREE index associated with a HASH partition key, = but I think we should allow them, > as long as their equality operators consider the same value as equal. Ah, yeah, I see we already have regression test cases that require that. I pushed the patch with some cosmetic revisions. I left out the regression test case though; it seemed pretty expensive considering that the code is already being exercised by existing cases. Thanks for the report and patch! regards, tom lane