UNLISTEN, DISCARD ALL and readonly standby

Поиск
Список
Период
Сортировка
От Shay Rojansky
Тема UNLISTEN, DISCARD ALL and readonly standby
Дата
Msg-id CADT4RqBweu7QKRYAYzeRW77b+MhJdUikNe45m+fL4GJSq_u2Fg@mail.gmail.com
обсуждение исходный текст
Ответы Re: UNLISTEN, DISCARD ALL and readonly standby
Список pgsql-hackers
Hi hackers.

The documentation for DISCARD ALL[1] state that it is equivalent to a series of commands which includes UNLISTEN *. On the other hand, the docs for hot standby mode[1], state that UNLISTEN * is unsupported while DISCARD is (although the docs don't specify whether this includes DISCARD ALL). I haven't done a test, but this seems to indicate that while DISCARD ALL is supported in hot standby mode, UNLISTEN is not, although its functionality is included in the former.

If this is indeed the case, is there any specific reason UNLISTEN can't be supported? This is actually quite important in the case of Npgsql (.NET driver). When a connection is returned to the connection pool, its state is reset - usually with a DISCARD ALL. However, if prepared statements exist, we avoid DISCARD ALL since it destroys those (the DEALLOCATE ALL component of DISCARD ALL), and we want to keep prepared statements across connection lifecycles for performance. So instead of issuing DISCARD ALL, Npgsql sends the equivalent commands excluding DEALLOCATE ALL - but UNLISTEN * fails when in recovery.

So ideally UNLISTEN would be made to work in standby model, just like DISCARD ALL. If DISCARD ALL is in fact unsupported in hot standby mode, then the docs should probably be updated to reflect that.

Thanks for any information or advice on this!


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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: Pull up sublink of type 'NOT NOT (expr)'
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: Online verification of checksums