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 1mU8DQ-0008TK-3t for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Sep 2021 13:59:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mU8DO-0002lV-V1 for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Sep 2021 13:59:42 +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 1mU8DO-0002jg-Mu for pgsql-hackers@lists.postgresql.org; Sat, 25 Sep 2021 13:59:42 +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 1mU8DI-0004oi-GL for pgsql-hackers@lists.postgresql.org; Sat, 25 Sep 2021 13:59:42 +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 18PDxXN32501729; Sat, 25 Sep 2021 09:59:33 -0400 From: Tom Lane To: Etsuro Fujita cc: Ibrar Ahmed , PostgreSQL Hackers , Neil Chen Subject: Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails In-reply-to: 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> Comments: In-reply-to Etsuro Fujita message dated "Sat, 25 Sep 2021 22:55:29 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2501727.1632578373.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sat, 25 Sep 2021 09:59:33 -0400 Message-ID: <2501728.1632578373@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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?) regards, tom lane