DEFINITIONS

Definitions More Info.
Definition ID12.106
TitlePOSTGRESQL
CategoryNOTES
Definitiondisable and enable users logins
Definition Description/*disable logins */
select 'ALTER ROLE '||usename||' NOLOGIN;'
from pg_catalog.pg_user
WHERE usename NOT IN ('replusr','zabbix','postgres','root');

/* enable login */
select 'ALTER ROLE '||usename||' LOGIN;'
from pg_catalog.pg_user
WHERE usename NOT IN ('replusr','zabbix','postgres','root');
RecordBycunay
Record Date12-09-2023 17:48:57
Düzenle
Kopyala
Sil