我是 Postgres 的新手,想知道是否有办法创建一个数据库用户,这样它就可以访问所有架构,包括那些尚未创建的架构,我的意思是访问所有当前和未来架构的.我的 Postgres 数据库中有多个具有相同表的架构。如果上述可能,我希望此用户在现有和未来创建的架构中仅对 2 个表进行 SELECT、INSERT、UPDATE。
You can use ALTER DEFAULT PRIVILEGES
to give a user permissions on future schemas and tables, but you cannot restrict that to certain table names.
You may be able to do that with an event trigger .
Personally, I would put GRANT
statements into the code that creates the tables.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.