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 1pk8hF-00009d-TY for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Apr 2023 19:21:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk8gG-0007R4-L5 for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Apr 2023 19:20:28 +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 1pk8gG-0007Qv-Be for pgsql-bugs@lists.postgresql.org; Wed, 05 Apr 2023 19:20:28 +0000 Received: from mail-gv0che01on2129.outbound.protection.outlook.com ([40.107.23.129] helo=CHE01-GV0-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pk8gD-0016Ur-1S for pgsql-bugs@lists.postgresql.org; Wed, 05 Apr 2023 19:20:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NRU0SPnYuejEDguP7PCh7ucW2LvDi93MoUnzH+RXcu9rql6jiANSp7la4PsLbg4ZwJJyBi0nSox6EqFX3o1F/qI7nYDAf1ttWf2izrsdnG9IC9DYRRU/uyX6nT4jRSFEU9mHbYJ0XV7CEYhxwFMwmwpcybWvriOV19T41K1FDTj18MeLaKmQeZ6TNAzyRpdSFKaI+9AEbVAwpALkgqCe/vnsvhmXAodJn2yx+g363ntrUMTZOUXcR78bJXCdamWoyjImLqPqt9jhT0ljutWvzTdxZJj+q4EOT45808seoHgoi+K4OAATcu9FD/cqZzlxH5Dq9kwv5F9tQAUgmf+GkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LTykYwBVExZMVUn5Wjb5XG/Ehf97eUU0MOV48DzvKHY=; b=hoL0DhATBxhxw4CQK0QH3zBfsSod8M5i7onI0yhJ9WcEUPanHgeXs11EsqYVosthBRINfbBmhDYcR7GUbi0aFjscR6Qj7yfaDcb+v9yC7N+TcaKXN8q4sbjZmk/tEZh1kwCXE18Bbuwc4F6cnS2femlJlzNsR1fHdJvtMn++1Mi/Cyu27kp16RpoGGkBsS/At9JopOx6+Rve/BUWaPjWSC1CxA7YytDwubhZuee/M52YX/w7Ae4KGvTrAYqtkfmJRRokFbhk1azoDRge8nhEiTRv6RuePYjM0no9OQ8zLyS/nkWn4OMjdDVxNVYlBPQ0wPByoK5fnWQh1mKAABtSXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=dbi-services.com; dmarc=pass action=none header.from=dbi-services.com; dkim=pass header.d=dbi-services.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dbi-services.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LTykYwBVExZMVUn5Wjb5XG/Ehf97eUU0MOV48DzvKHY=; b=U1gdXwXXcODWXjLSLcWAGJeDHrp/M1u129a/CVORc4iC1HB9oOj6cCVBiDululux9MBbKRYbixKOXkD+rkBhKfW0OukdeX7JyzsyCewArOlZ4FoPP+mKjSHE/DIJ6GTnWJNxF8/I9l2FyjUiOFv6apoFc4b+k3atemumyE2Kw+w= Received: from GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:2f::6) by ZR2P278MB1148.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:60::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.29; Wed, 5 Apr 2023 19:20:21 +0000 Received: from GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM ([fe80::27c0:f6a3:70b7:f736]) by GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM ([fe80::27c0:f6a3:70b7:f736%7]) with mapi id 15.20.6254.035; Wed, 5 Apr 2023 19:20:21 +0000 From: "Daniel Westermann (DWE)" To: Tom Lane 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 Thread-Topic: Wrong results with postgres_fdw and merge anti join from RHEL 7.9 to RHEL 8.7 Thread-Index: AQHZZ+vE6kJwQe22OUaFWDbhV0RzRa8dDIOAgAABBo6AAAWkAIAAAsxG Date: Wed, 5 Apr 2023 19:20:21 +0000 Message-ID: References: <2017352.1680720065@sss.pgh.pa.us> <2020213.1680721496@sss.pgh.pa.us> In-Reply-To: <2020213.1680721496@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=dbi-services.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV0P278MB0419:EE_|ZR2P278MB1148:EE_ x-ms-office365-filtering-correlation-id: 88a2a5a2-6d3d-4b15-e44d-08db360accc5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: epOx90GtIax+tShzNHky+2Ne0uahyaz5J580wixmU6RSgN8a/LjVUfRe9FGSLLXuYMkTIpMMJlWbNQX+7MjCj63Tqm5PWscvSmI/lbLsNbS6/LAclgEPt6iQvyrSNe+XB3eWapUkNGvwqKP3hs48vc+ZZt5dZeO2CeYjrvev6ETbOLGGmM7oSZSHITRxeSY+0x6os3q1sB2EOo0bz3C9m9/3q+pgnMMbRYVGnf5WzForwvuy5lKSRc1Ynj+Efgv0vhZOp3EZG4iUBev5juvo++yRitvSOgrdzUJ5kKdHPZkuCO1LXWwjyuiN4cd2R0WLfiIWa1Ace8ia4aisKdd5vOoiixD7bQ0DGGdGcTyyqjQgRMBpS24QnwCYs69e/afNfANVgY3GYw4Iw0k+xfGs5Vwc+B50eNjHLo+gwL4S2MNtmSs7X/YVdHe6v2LaCA3QfUqVv5Lu9tbscZPyPmzmEtYEmqAz+E0GCMlAFPPD2vpqKixVWHyP6zR6Vbrey+WILuqGzvOH34SJU7Ak+e3dzbuxHd89vCbVaT83yiln44f/kdr1fexFGgAiiaZGXVlkaCIVBMAL7VYr3s0NT7OERS1amtOv6GoFTHRTi08Cb5eZdsxtM7kiFr6N9b2d2s7W x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(366004)(346002)(39840400004)(376002)(451199021)(478600001)(7696005)(71200400001)(38070700005)(2906002)(55016003)(186003)(6506007)(19627405001)(316002)(83380400001)(9686003)(66946007)(91956017)(66476007)(66556008)(5660300002)(122000001)(41300700001)(8676002)(52536014)(6916009)(38100700002)(66446008)(4326008)(64756008)(8936002)(76116006)(33656002)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?dNOomykknnDA7J9HA889GmhffayO7/8IbmiFvzIh7fBoiDALmQ+I95FUaD?= =?iso-8859-1?Q?Xz1kchVAVjVWtDDg3kHOiwjN7DPSUL5nPw3NLeqcZKAp3ylwa9h2zVirMl?= =?iso-8859-1?Q?jxlWtRsxDNlq4rrrgv1N+6XFICxeUt3R44IU8doX3A7e6AkswJeyhqrOlP?= =?iso-8859-1?Q?mpXEf/ZnJkAp3ovhyIfGpg4epR5L7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-1?Q?Tflt7GeWRx35eFevDJzoYXKDeGhZtbycKSLLijklvzX++LH1UD+Tzm7SLc?= =?iso-8859-1?Q?vy/nFJHXsdMvv1xcq/d7LRSmmUD50/Gre1PsJxhdravIdZaNeoq6uLZOAq?= =?iso-8859-1?Q?+/iAzf9W/OaZqd5ELKJEiKaS8idp6bziU5pQRIe0ERHaAX4/LIr96765Vq?= =?iso-8859-1?Q?518LIes4hs+xcCCHXPCdg0Q6ctjSZPgpIB+clOwRE+pFHCzbVWiplyeDBr?= =?iso-8859-1?Q?44xkYZu7Zty+uGr/WH14sqoq+gagPBUSqEHptcYCcKvEIYcm1726eV5juf?= =?iso-8859-1?Q?NNxLhedKPZ6ZnOPGuAGXFjYfeb512LCS+9npv0zKmI13sVLqXeNN+vabj/?= =?iso-8859-1?Q?q7pZUZZV7srpDmG/UGjc6cs5rLtTOZIP5G3xnICVHK0yGlxMriFnhnvzfl?= =?iso-8859-1?Q?nZql2CdIXfR6b4QQfQpiUA4vZ4gGKOuEEgyeSAVU56jQ6ArMTC2jP601XN?= =?iso-8859-1?Q?UQetE7fSVGhifxM/llW5BzVMM245rfpFtQ/uE3i3c+ShK/fJ+b8+Q3vo8D?= =?iso-8859-1?Q?vmqG/FLc55DARpmY0GEFxj9wQKW1cP/3SpwsctIZNcpzsYb9+5PdSNWdTw?= =?iso-8859-1?Q?U2Oi8UeAvpvPQnq+onwtGa6E0Vx3beAfFHDtxDZk7i7TMIjoOx7zvSLt3Y?= =?iso-8859-1?Q?3VDHbPD8wfYYvswLUG3YZx8XA=3D?= Content-Type: multipart/alternative; boundary="_000_GV0P278MB041930B2E5FE2DFEC77FE36FD2909GV0P278MB0419CHEP_" MIME-Version: 1.0 X-OriginatorOrg: dbi-services.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 88a2a5a2-6d3d-4b15-e44d-08db360accc5 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2023 19:20:21.5592 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b9c70613-b1ea-47b7-9fdd-e6f3a67ce75c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: h59TUT6dFC3yXJoxgWtGszLeTbHAejmJ+liRZOKfBb7xtCJDZK/HROrlx6dQA7nu+ExID/kz0Zz9krGGmHwgX4e0ZFIMCobwaqX3rgaRDAnNBHAp7bSQGSkpXJ2Iy+Yu X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR2P278MB1148 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_GV0P278MB041930B2E5FE2DFEC77FE36FD2909GV0P278MB0419CHEP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable >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. We did a rebuild of the indexes and also vacuum full, just to be sure. Did = not change anything. >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? I can probably provide a dump, but I've to ask. Would that help? >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. I'll try do that tomorrow. Thanks Daniel --_000_GV0P278MB041930B2E5FE2DFEC77FE36FD2909GV0P278MB0419CHEP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
>Yeah, doesn't look like you've made any configuration mistakes.
>So either the two OSes sort dif= ferently, or there's index corruption
>causing the indexscan to give bogus output.

We did a rebuild of the indexes and= also vacuum full, just to be sure. Did not change anything.

>The sample data you showed seemed to only involve numeric-ish strings,<= br> >which would be highly unlikely to change sort order across locale
>updates.  But maybe there are weirder entries elsewhere in the col= umn?

I can probably provide a dump, but = I've to ask. Would that help?

>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 does= n'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<= br> >using anywhere else in the local database.

I'll try do that tomorrow.

Thanks
Daniel






--_000_GV0P278MB041930B2E5FE2DFEC77FE36FD2909GV0P278MB0419CHEP_--