本文介绍了在PostgreSQL中将来的表上授予特权?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在运行PostgreSQL 9.3.1。我有 test 数据库和 backup 用户,该用户用于备份数据库。向所有当前表授予特权没有问题,但是每次将新表添加到架构时,我都必须授予特权。
I am running PostgreSQL 9.3.1. I have test database and backup user which is used to backup the database. I have no problems with granting privileges to all current tables, but I have to grant privileges each time the new table is added to schema.
createdb test psql test test=# create table foo(); CREATE TABLE test=# grant all on all tables in schema public to backup; GRANT test=# create table bar(); CREATE TABLE psql -U backup test test=> select * from foo; test=> select * from bar; ERROR: permission denied for relation bar的权限被拒绝是否有可能授予对表的访问权限
Is it possible to grant access to tables which will be created in future without making user owner of the table?
推荐答案看来解决方案是更改 backup 用户:
It looks like the solution is to alter default privileges for backup user:
alter default privileges in schema public grant all on tables to backup; alter default privileges in schema public grant all on sequences to backup;更多推荐
在PostgreSQL中将来的表上授予特权?
发布评论