Re: DROP ROLE: how to detect active sessions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ken Lalonde <kenl@xxxxxx> 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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux