SET default_transaction_read_only = off; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; CREATE ROLE bss_zy; ALTER ROLE bss_zy WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS CONNECTION LIMIT 1000 PASSWORD 'SCRAM-SHA-256$4096:O06nj9q2zG2q2Cqf4gzypg==$T3ilS9bwsqLkXSGd20BLtq7jhrMobHiDC0RbHQcrPT0=:LMEIJN+ud4dCBj2W8Gt/jqfzt+jIm947q26WDwr9F/w='; GRANT comm TO tysc_query GRANTED BY root; GRANT pg_read_all_stats TO ampmon GRANTED BY root; GRANT pg_read_all_stats TO prometheus GRANTED BY root; GRANT root TO prometheus GRANTED BY root;
时间: 2024-03-29 14:37:35 浏览: 87
VFP的SET命令一览表.zip_vfp_vfp set命令集合
这是一段 SQL 语句,其中包含了一些用于创建和授权角色、设置参数的命令。具体来说:
- `SET default_transaction_read_only = off;` 设置默认事务为可读写。
- `SET client_encoding = 'UTF8';` 设置客户端字符集为 UTF8。
- `SET standard_conforming_strings = on;` 设置标准字符串格式为启用。
- `CREATE ROLE bss_zy;` 创建名为 bss_zy 的角色。
- `ALTER ROLE bss_zy WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS CONNECTION LIMIT 1000 PASSWORD 'SCRAM-SHA-256$4096:O06nj9q2zG2q2Cqf4gzypg==$T3ilS9bwsqLkXSGd20BLtq7jhrMobHiDC0RbHQcrPT0=:LMEIJN+ud4dCBj2W8Gt/jqfzt+jIm947q26WDwr9F/w=';` 修改 bss_zy 角色的属性,包括不是超级用户、不继承权限、不能创建角色和数据库、可以登录、不能进行复制操作、不能绕过行级安全策略、同时连接数限制为 1000,密码为哈希值。
- `GRANT comm TO tysc_query GRANTED BY root;` 授权 root 用户给 tysc_query 用户组授予 comm 权限。
- `GRANT pg_read_all_stats TO ampmon GRANTED BY root;` 授权 root 用户给 ampmon 用户组授予 pg_read_all_stats 权限。
- `GRANT pg_read_all_stats TO prometheus GRANTED BY root;` 授权 root 用户给 prometheus 用户组授予 pg_read_all_stats 权限。
- `GRANT root TO prometheus GRANTED BY root;` 授权 root 用户给 prometheus 用户组授予 root 权限。
阅读全文