概述
I ended up here because my DB user saw only a few tables and not the newer ones. If this is your case, this has helped me.
-
Grant privileges to all existing tables:
GRANT SELECT ON ALL TABLES IN SCHEMA public TO user;
-
Grant privileges to all new tables to be created in future (via default privileges):
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO user;
-
You can also double-check that all tables are granted correctly.
-
Count all existing tables:
SELECT COUNT(*) FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema';
-
Count all tables the user has access to:
SELECT COUNT(*) FROM information_schema.role_table_grants WHERE grantee = 'user';
The count of last two queries must be the same.
-
最后
以上就是无限彩虹为你收集整理的postgresql 授权的全部内容,希望文章能够帮你解决postgresql 授权所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复