Re: DROP ROLE: how to detect active sessions?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DROP ROLE: how to detect active sessions?
Дата
Msg-id 27773.1287685132@sss.pgh.pa.us
обсуждение исходный текст
Ответ на DROP ROLE: how to detect active sessions?  (Ken Lalonde <kenl@gap.ca>)
Ответы Re: DROP ROLE: how to detect active sessions?  (Ken Lalonde <kenl@gap.ca>)
Список pgsql-admin
Ken Lalonde <kenl@gap.ca> writes:
> Is there any way to determine if a given role has any active sessions?

Not if you're using SET ROLE.  pg_stat_activity will show you the
login role names for active sessions.  Do you really need SET ROLE
rather than logging in with the appropriate username?

There are going to be race conditions in any case, of course.
Probably the best solution is to just not try to drop roles
except when the system is idle.

            regards, tom lane

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

Предыдущее
От: Ken Lalonde
Дата:
Сообщение: DROP ROLE: how to detect active sessions?
Следующее
От: Ken Lalonde
Дата:
Сообщение: Re: DROP ROLE: how to detect active sessions?