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 1mWOLi-0001UN-2U for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Oct 2021 19:37:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mWOLh-0007Tp-1r for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Oct 2021 19:37:37 +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 1mWOLg-0007Th-Nx for pgsql-hackers@lists.postgresql.org; Fri, 01 Oct 2021 19:37:36 +0000 Received: from smtp-fw-80006.amazon.com ([99.78.197.217]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mWOLe-0002ic-D1 for pgsql-hackers@lists.postgresql.org; Fri, 01 Oct 2021 19:37:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1633117054; x=1664653054; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=5BuFE+SuFfzkIQURF18OOXdIQe0ND1wcodZE//QzocU=; b=HizDHfRnYawZsLkMfCAFIKSwF7zEnipBXDD7rPbC8Uhzh2d8ahHWzVjh 7LtviPhETAITwRrXXDeQ1yAUazVaGG1MJjQG3I6heuQomWxyvmR/+QisB Roq+0w7Rab7jdvrhdYp3G8oGmEgSUzfsQL1oS/YSnZL4t6OXmlIIvZ0j3 0=; X-IronPort-AV: E=Sophos;i="5.85,340,1624320000"; d="scan'208";a="31270783" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-cb1ffea5.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 01 Oct 2021 19:37:32 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2a-cb1ffea5.us-west-2.amazon.com (Postfix) with ESMTPS id 2DA5061122; Fri, 1 Oct 2021 19:37:32 +0000 (UTC) Received: from EX13D18UWA002.ant.amazon.com (10.43.160.199) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 1 Oct 2021 19:37:31 +0000 Received: from [10.111.232.16] (10.43.160.146) by EX13D18UWA002.ant.amazon.com (10.43.160.199) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 1 Oct 2021 19:37:31 +0000 Message-ID: Date: Fri, 1 Oct 2021 12:37:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails Content-Language: en-US To: Tom Lane , Etsuro Fujita CC: Ibrar Ahmed , PostgreSQL Hackers , Neil Chen References: <16583-4dc8f6c3b8ed24fa@postgresql.org> <422379.1612684550@sss.pgh.pa.us> <161476090989.29967.7097745522340560681.pgcf@coridan.postgresql.org> <3404441.1626208861@sss.pgh.pa.us> <2201880.1630528969@sss.pgh.pa.us> <3683993.1631203221@sss.pgh.pa.us> <2438715.1632510693@sss.pgh.pa.us> <2501728.1632578373@sss.pgh.pa.us> From: Jeremy Schneider In-Reply-To: <2501728.1632578373@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.43.160.146] X-ClientProxiedBy: EX13D24UWA001.ant.amazon.com (10.43.160.138) To EX13D18UWA002.ant.amazon.com (10.43.160.199) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/25/21 06:59, Tom Lane wrote: > Etsuro Fujita writes: >> On Sat, Sep 25, 2021 at 4:11 AM Tom Lane wrote: >>> Longer-term, it seems like we really have to be able to represent >>> the notion of a remote column that has an "unknown" collation (that >>> is, one that doesn't match any local collation, or at least is not >>> known to do so). > >> +1 > >> In addition, a) we should detect whether local “default” matches >> remote “default”, > > If we had a way to do that, most of the problem here wouldn't exist. > I don't believe we can do it reliably. (Maybe we could put it on > the user to tell us, say via a foreign-server property?) A related situation is local and remote servers having different versions of glibc - in particular, pre versus post 2.28. I think there's still a major brewing storm here that hasn't yet fully hit the world of PG users. I know PG throws the warning message for queries using the wrong collation library version, but I can't remember - does the query still execute? If so, then glibc 2.28 seems to significnatly raise the likelihood of wrong query results across the entire global PG install base. Does PostgreSQL handle cases which involve FDWs (ala this thread) or hot standbys? Would be nice if some approach could be found to solve that problem at the same time as the one discussed on this thread. -Jeremy -- Jeremy Schneider Database Engineer Amazon Web Services