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 1oO4ZC-0006aF-ML for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Aug 2022 21:57:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oO4ZA-0005aU-Ue for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Aug 2022 21:57:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oO4ZA-0005aD-ML for pgsql-bugs@lists.postgresql.org; Tue, 16 Aug 2022 21:57:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oO4Z8-0005tA-B0 for pgsql-bugs@lists.postgresql.org; Tue, 16 Aug 2022 21:57:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 27GLvaNk1551759; Tue, 16 Aug 2022 17:57:36 -0400 From: Tom Lane To: Christophe Pettus cc: PostgreSQL mailing lists Subject: Re: = TRUE vs IS TRUE confuses partition index creation In-reply-to: <8864BFAA-81FD-4BF9-8E06-7DEB8D4164ED@thebuild.com> References: <8864BFAA-81FD-4BF9-8E06-7DEB8D4164ED@thebuild.com> Comments: In-reply-to Christophe Pettus message dated "Tue, 16 Aug 2022 14:33:51 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1551757.1660687056.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 16 Aug 2022 17:57:36 -0400 Message-ID: <1551758.1660687056@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Christophe Pettus writes: > When an index is created on the root of a (declarative) partitioned tabl= e, that index is also created on the children, unless there is an existing= index on that child that matches the definition of the new index. It see= ms that using `=3D TRUE` confuses it, compared to `IS TRUE`. IIRC, "b =3D true" will be simplified to just "b" somewhere in expression preprocessing. I'm betting that something in the partitioned index matching code is applying that preprocessing to one index predicate and not the other, whereupon they look different. If that's the explanation, there are likely other cases that should match and fail to. regards, tom lane