BUG #19488: Standby connection fails after dropping on login event trigger enabled always

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: kyzevan23(at)mail(dot)ru
Subject: BUG #19488: Standby connection fails after dropping on login event trigger enabled always
Date: 2026-05-19 11:06:06
Message-ID: 19488-d7ccfca2bf6b74b0@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19488
Logged by: Egor Chindyaskin
Email address: kyzevan23(at)mail(dot)ru
PostgreSQL version: 18.4
Operating system: Ubuntu 26.04
Description:

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2026-05-19 15:35:04 BUG #19379: Role pg_read_all_data don't allowed read large objects
Previous Message Adrian Mönnich 2026-05-19 10:10:44 Re: BUG #19449: Massive performance degradation for complex query on Postgres 16+ (few seconds -> multiple hours)