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 1nqc2e-0001kJ-Tx for pgsql-bugs@arkaria.postgresql.org; Mon, 16 May 2022 14:49:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nqc2d-0003cz-QE for pgsql-bugs@arkaria.postgresql.org; Mon, 16 May 2022 14:49:47 +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 1nqc2d-0003co-II for pgsql-bugs@lists.postgresql.org; Mon, 16 May 2022 14:49:47 +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 1nqc2V-0001m6-QY for pgsql-bugs@lists.postgresql.org; Mon, 16 May 2022 14:49:47 +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 24GEnanV1322025; Mon, 16 May 2022 10:49:38 -0400 From: Tom Lane To: equincerot@yahoo.fr cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17483: postgres_fdw used with text to_tsvector and custom search configuration In-reply-to: <17483-795757fa99607659@postgresql.org> References: <17483-795757fa99607659@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 16 May 2022 09:25:01 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1322023.1652712576.1@sss.pgh.pa.us> Date: Mon, 16 May 2022 10:49:36 -0400 Message-ID: <1322024.1652712576@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > I have an issue with the evaluation of to_tsvector and custom search > configuration through foreign data wrapper (from PG to PG). There is no chance whatsoever of a to_tsvector call working in a foreign query unless the referenced text search config exists (with identical definitions) on both ends. It has to exist locally or the parser will not be able to make sense of the command. It has to exist remotely if you'd like the operation to be pushed down to the remote. (Given the large potential for user error there, I'm a bit worried that we should never have marked this function safe-to-ship in the first place.) The other thing you're running into is that if the text search config isn't defined in the pg_catalog schema, it's not visible in the restricted search path that the remote session will use. The query shipped to the far end should handle that by writing "'public.custom_search'::regconfig", but it evidently doesn't --- that feels like a bug, indeed. Or perhaps we ought to reduce the error hazards a bit by not shipping query conditions that involve non-built-in configurations? But likely that would draw performance complaints. regards, tom lane