我的查询:
SELECT clone_schema('my_application_template_schema','user1_gmail_com');CREATE USER user1_gmail_com WITH PASSWORD 'myloginpassword';REVOKE ALL ON ALL tableS IN SCHEMA user1_gmail_com FROM PUBliC;GRANT SELECT ON ALL tableS IN SCHEMA user1_gmail_com TO user1_gmail_com;
sql错误:
ERROR: permission denIEd for schema user1_gmail_com at character 46In statement:SELECT COUNT(*) AS total FROM (SELECT * FROM "user1_gmail_com"."organisations_table") AS sub
更新工作查询
SELECT clone_schema('my_application_template_schema','user1_gmail_com');CREATE USER user1_gmail_com WITH PASSWORD 'myloginpassword';REVOKE ALL ON ALL tableS IN SCHEMA user1_gmail_com FROM PUBliC;GRANT USAGE ON SCHEMA user1_gmail_com TO user1_gmail_com;GRANT SELECT ON ALL tableS IN SCHEMA user1_gmail_com TO user1_gmail_com;您不仅需要授予对架构中的表的访问权限,还可以授予架构本身的访问权限。
从manual:
By default,users cannot access any objects in schemas they do not own. To allow that,the owner of the schema must grant the USAGE privilege on the schema.
因此,要么将创建的用户设置为模式的所有者,要么将该模式的USAGE授予该用户。
总结以上是内存溢出为你收集整理的postgresql – 错误:在字符46处拒绝模式user1_gmail_com的权限全部内容,希望文章能够帮你解决postgresql – 错误:在字符46处拒绝模式user1_gmail_com的权限所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)