[PATCH] Allow UNLISTEN during recovery
Shay Rojansky <roji@roji.org>
From: Shay Rojansky <roji@roji.org>
To: pgsql-hackers@lists.postgresql.org
Date: 2018-11-18T16:49:01Z
Lists: pgsql-hackers
Attachments
- allow-UNLISTEN-during-recovery.patch (text/x-patch) patch
Hi all, Here is a tiny patch removing PreventCommandDuringRecovery() for UNLISTEN. See previous discussion in https://www.postgresql.org/message-id/CADT4RqBweu7QKRYAYzeRW77b%2BMhJdUikNe45m%2BfL4GJSq_u2Fg%40mail.gmail.com . In a nutshell, this prevents an error being raised when UNLISTEN is issued during recovery. The operation is a no-op (since LISTEN is still disallowed). This logic here is that some clients (namely Npgsql) issue UNLISTEN * to clear connection state (in the connection pool), but this needlessly breaks when the backend is in recovery. On a related note, there currently doesn't seem to be a good way for clients to know whether the backend is in recovery. As a backend can come out of recovery at any point, perhaps an asynchronous ParameterStatus announcing this state change could be useful. Hopefully this also qualifies for backporting to earlier version branches. Shay
Commits
-
Allow UNLISTEN in hot-standby mode.
- ebfe20dc706b 12.0 landed
- e8ec19cd13a5 10.7 landed
- c0aed6959541 11.2 landed
- 741ee48900c5 9.5.16 landed
- 549d2a238a70 9.4.21 landed
- 0d5b27351225 9.6.12 landed