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 1pk8RL-0007lr-Mf for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Apr 2023 19:05:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk8RK-00089m-Kh for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Apr 2023 19:05:02 +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 1pk8RK-00089c-Co for pgsql-bugs@lists.postgresql.org; Wed, 05 Apr 2023 19:05:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk8RI-0007kh-8b for pgsql-bugs@lists.postgresql.org; Wed, 05 Apr 2023 19:05:01 +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 335J4u562020214; Wed, 5 Apr 2023 15:04:56 -0400 From: Tom Lane To: "Daniel Westermann (DWE)" cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: Wrong results with postgres_fdw and merge anti join from RHEL 7.9 to RHEL 8.7 In-reply-to: References: <2017352.1680720065@sss.pgh.pa.us> Comments: In-reply-to "Daniel Westermann (DWE)" message dated "Wed, 05 Apr 2023 18:51:51 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2020212.1680721496.1@sss.pgh.pa.us> Date: Wed, 05 Apr 2023 15:04:56 -0400 Message-ID: <2020213.1680721496@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Daniel Westermann (DWE)" writes: > Both instances use the same collation; Yeah, doesn't look like you've made any configuration mistakes. So either the two OSes sort differently, or there's index corruption causing the indexscan to give bogus output. The sample data you showed seemed to only involve numeric-ish strings, which would be highly unlikely to change sort order across locale updates. But maybe there are weirder entries elsewhere in the column? Anyway, the first thing I'd try is reindexing both tables --- doesn't look like they're large enough to make that painful. If that doesn't fix it you must have a collation difference. (Asking both systems for a sorted dump of their cprd columns could help confirm that.) You could probably hack around that, if an OS update isn't feasible, by labelling the foreign table's column with some collation you aren't using anywhere else in the local database. regards, tom lane