Create a readonly user in Postgres

前端之家收集整理的这篇文章主要介绍了Create a readonly user in Postgres前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
CREATE USER backup_userWITH ENCRYPTED PASSWORD 'qux94874';
GRANT CONNECT ON DATABASE foo_db to backup_user;
GRANT CONNECT ON DATABASE bar_db to backup_user;
\c foo
GRANT USAGE ON SCHEMA public to backup_user;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO backup_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO backup_user;
\c bar
GRANT USAGE ON SCHEMA public to backup_user;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO backup_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO backup_user;
原文链接:https://www.f2er.com/postgresql/194957.html

猜你在找的Postgre SQL相关文章