📌  相关文章
📜  授予 postgres sql 用户只读访问权限的命令 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:13.595000             🧑  作者: Mango

代码示例1
sudo -u postgres psql
CREATE USER username WITH PASSWORD 'your_password';
GRANT CONNECT ON DATABASE database_name TO username;
GRANT USAGE ON SCHEMA schema_name TO username;
GRANT SELECT ON ALL TABLES IN SCHEMA schema_name TO username;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name
GRANT SELECT ON TABLES TO username;