DEFINITIONS
Definitions More Info.
Definition ID
16.118
Title
POSTGRESQL
Category
NOTES
Definition
kill all sessions users with FOR loop
Definition Description
DO
$$
DECLARE
r RECORD;
BEGIN
FOR r IN (SELECT pid FROM pg_stat_activity WHERE usename = 'isinolsun_chat_appuser') LOOP
EXECUTE 'SELECT pg_terminate_backend(' || r.pid || ');';
END LOOP;
END
$$;
RecordBy
cunay
Record Date
07-08-2024 11:19:42
Düzenle
Kopyala
Sil