Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sxWAi-00AbDw-9O for pgsql-bugs@arkaria.postgresql.org; Sun, 06 Oct 2024 18:40:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sxWAg-000O5Q-6F for pgsql-bugs@arkaria.postgresql.org; Sun, 06 Oct 2024 18:39:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sxWAf-000O5H-Tk for pgsql-bugs@lists.postgresql.org; Sun, 06 Oct 2024 18:39:57 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sxWAd-002pZ5-Cj for pgsql-bugs@lists.postgresql.org; Sun, 06 Oct 2024 18:39:56 +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 496IdoEd1381067; Sun, 6 Oct 2024 14:39:50 -0400 From: Tom Lane To: Erik Wienhold cc: Murat =?utf-8?Q?Efendio=C4=9Flu?= , Jeff Davis , pgsql-bugs@lists.postgresql.org Subject: Re: Error when setting default_text_search_config In-reply-to: <9c480df9-720b-4419-85c6-09113f5d6f0a@ewie.name> References: <26c28873-85ca-4360-a5e9-1cc691a05451@ewie.name> <9c480df9-720b-4419-85c6-09113f5d6f0a@ewie.name> Comments: In-reply-to Erik Wienhold message dated "Sun, 06 Oct 2024 20:08:35 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1381065.1728239990.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Oct 2024 14:39:50 -0400 Message-ID: <1381066.1728239990@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Erik Wienhold writes: >> I can reproduce a segfault on my Arch machine with 17.0, but only by >> also connecting to that database afterwards: >> = >> postgres=3D# create database regress; >> postgres=3D# alter database regress set default_text_search_config to '= german'; >> postgres=3D# \c regress >> connection to server at "localhost" (::1), port 15432 failed: server cl= osed the connection unexpectedly >> This probably means the server terminated abnormally >> before or while processing the request. Yeah, I see that too (with any value of default_text_search_config). The problem is that InitPostgres does /* Process pg_db_role_setting options */ process_settings(MyDatabaseId, GetSessionUserId()); before it calls InitializeSearchPath(), and recomputeNamespacePath isn't ready for that. Evidently broken in f26c2368d. I suppose we could just move the InitializeSearchPath call up a bit (the comments in postinit.c are misleading about what it actually does), but I wonder whether the cache-is-valid assumptions in namespace.c ought to be rethought. It seems unduly fragile as-is. regards, tom lane