Re: Can I use Postgres rules to reset session variables before/after queries?

Поиск
Список
Период
Сортировка
Искать
От
Christophe Pettus
Тема
Re: Can I use Postgres rules to reset session variables before/after queries?
Дата
Msg-id
8828B96C-3953-49B4-BE8D-5D6591F407F2@thebuild.com
Ответ на
Список
Дерево обсуждения
Can I use Postgres rules to reset session variables before/after queries? Andrew Stuart <andrew@salesgrid.com.au>
Re: Can I use Postgres rules to reset session variables before/after queries? Christophe Pettus <xof@thebuild.com>
Re: Can I use Postgres rules to reset session variables before/after queries? Tom Lane <tgl@sss.pgh.pa.us>


> On Jan 24, 2021, at 21:00, Andrew Stuart  wrote:
> Can anyone suggest if session variables can be SET/RESET using Postgres rules, or optionally perhaps there is a better way to do so?

PostgreSQL poolers generally use the RESET ALL command when reassigning a session to clear the session state:

	https://www.postgresql.org/docs/current/sql-reset.html

You probably want to do this rather than try to intercept every single operation in order to the reset at the end.

--
-- Christophe Pettus
   xof@thebuild.com



В списке pgsql-general по дате отправления
От: Andrew Stuart
Дата:
От: Tom Lane
Дата:
FAQ