Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqcmb-007uwB-Qa for pgsql-committers@arkaria.postgresql.org; Fri, 07 Mar 2025 18:50:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tqcma-00EpP8-9C for pgsql-committers@arkaria.postgresql.org; Fri, 07 Mar 2025 18:50:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqcma-00EpP0-1p for pgsql-committers@lists.postgresql.org; Fri, 07 Mar 2025 18:50:52 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tqcmY-001Xge-16 for pgsql-committers@lists.postgresql.org; Fri, 07 Mar 2025 18:50:51 +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 527IokD81113685; Fri, 7 Mar 2025 13:50:46 -0500 From: Tom Lane To: Peter Eisentraut cc: Mark Dilger , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Generalize hash and ordering support in amapi In-reply-to: <0f6a8a8a-b42e-433b-89cd-ee121d0919b3@eisentraut.org> References: <2557074.1740673653@sss.pgh.pa.us> <1789fe14-c19d-4025-9201-0eb8faa0840b@eisentraut.org> <165328.1741109742@sss.pgh.pa.us> <0f6a8a8a-b42e-433b-89cd-ee121d0919b3@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Fri, 07 Mar 2025 12:05:53 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1113683.1741373446.1@sss.pgh.pa.us> Date: Fri, 07 Mar 2025 13:50:46 -0500 Message-ID: <1113684.1741373446@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > I have committed fixes for these issues along the lines you suggested. Thanks. There is a typo in hashhandler: - amroutine->amcancrosscompare = true; + amroutine->amconsistentequality = true; + amroutine->amconsistentequality = false; The second line should be setting amconsistentordering = false. Also, may I suggest one more thing? I think the test in comparison_ops_are_compatible should be just - if (amroutine->amcanorder && amroutine->amconsistentordering) + if (amroutine->amconsistentordering) (and the comment for it needs adjustment too). To my mind, amconsistentordering is a static declaration that operators within one of the AM's opfamilies are expected to have this property. That could be true whether or not the AM is capable of returning tuples in order. So although these flags might commonly be set together, I think they are independent properties. regards, tom lane