DEFINITIONS

Definitions More Info.
Definition ID16.118
TitlePOSTGRESQL
CategoryNOTES
Definitionkill all sessions users with FOR loop
Definition DescriptionDO
$$
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
$$;
RecordBycunay
Record Date07-08-2024 11:19:42
Düzenle
Kopyala
Sil