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.96) (envelope-from ) id 1wPRd3-000jgo-0b for pgsql-bugs@arkaria.postgresql.org; Tue, 19 May 2026 21:05:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPRd1-00591q-0r for pgsql-bugs@arkaria.postgresql.org; Tue, 19 May 2026 21:05:28 +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.96) (envelope-from ) id 1wPII0-004DYp-0m for pgsql-bugs@lists.postgresql.org; Tue, 19 May 2026 11:07:09 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wPIHx-00000000JjI-1dLw for pgsql-bugs@lists.postgresql.org; Tue, 19 May 2026 11:07:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=fk5exGCpRcgHEOsmvpOcP4pk/P2hcxBeKc6WFQWRYpE=; b=w7ZzUaN3HEBG2kf1jsG3Pp2uG0 3BUpzWHUJN5vWle76vwvhk58FsY8Qr5W0B6v8uNpeY1+7t4JfhC+3zSL6xH2dJobz3DamKDFKAHvh gPols979huKUV7AifIgRwO5KkF/sS0yqLZB3w8oNjICJP+XWp8vIOfv7H/SFSGAHiAxfusx4k+CMh a/Adhv9qX5FMIj0kZ/CYAh35uY0478QCf44vBOxzACy5XiV0xGBUKUFR062ytBgETzAXQEHomAvlB QamSdCjDPYmKrE9xMB8HMUYn+F4BZM98HG6YYhNa7wtrf1MaOw35t6D+exX5bD5ZYNf5mQa8o9JF3 5lzHUIJA==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wPIHv-000wwE-1Y for pgsql-bugs@lists.postgresql.org; Tue, 19 May 2026 11:07:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPIHv-001xYG-0N for pgsql-bugs@lists.postgresql.org; Tue, 19 May 2026 11:07:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19488: Standby connection fails after dropping on login event trigger enabled always To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: kyzevan23@mail.ru Reply-To: kyzevan23@mail.ru, pgsql-bugs@lists.postgresql.org Date: Tue, 19 May 2026 11:06:06 +0000 Message-ID: <19488-d7ccfca2bf6b74b0@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19488 Logged by: Egor Chindyaskin Email address: kyzevan23@mail.ru PostgreSQL version: 18.4 Operating system: Ubuntu 26.04 Description: =20 Hello! In a master + physical standby setup, connection to the standby fails after creating a login event trigger on the master, enabling it as always, and then dropping it without reconnecting to the master. Also reproduces on master branch. Steps to reproduce: 1. Run the following SQL script on the master: CREATE OR REPLACE FUNCTION init_session() RETURNS event_trigger SECURITY DEFINER LANGUAGE plpgsql AS $$ BEGIN RAISE NOTICE 'init_session'; END; $$; CREATE EVENT TRIGGER init_session ON login EXECUTE FUNCTION init_session(); ALTER EVENT TRIGGER init_session ENABLE ALWAYS; DROP EVENT TRIGGER init_session; 2. Try to connect to the standby: psql -p5433 Result: psql: error: connection to server on socket "/tmp/.s.PGSQL.5433" failed: FATAL: cannot acquire lock mode AccessExclusiveLock on database objects while recovery is in progress HINT: Only RowExclusiveLock or less can be acquired on database objects during recovery. -- With best regards, Egor Chindyaskin Postgres Professional: https://postgrespro.com