[PATCH] Allow UNLISTEN during recovery

Поиск
Список
Период
Сортировка
От Shay Rojansky
Тема [PATCH] Allow UNLISTEN during recovery
Дата
Msg-id CADT4RqCf2gA_TJtPAjnGzkC3ZiexfBZiLmA-mV66e4UyuVv8bA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Allow UNLISTEN during recovery  (Mi Tar <mmitar@gmail.com>)
Список pgsql-hackers
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
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dmitry Dolgov
Дата:
Сообщение: Re: New GUC to sample log queries
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: _isnan() on Windows