英文:
Predefined role(s) to use in PostgreSQL in order to create a login role with privileges to automate database development
问题
我正在设置一个用于Java应用程序的AWS Aurora (PostgreSQL) 15.x
实例。我只能通过rds_superuser
账户访问该实例,而不能使用psql
。
我最初要配置三个登录角色:
- 一个只读的
user_ro
登录角色,基于pg_read_all_data
。 - 一个读/写的
user_rw
登录角色,基于pg_read_all_data
和pg_write_all_data
。 - 一个
user_liquibase
登录角色,具有通过执行模式更改和种子数据来自动化数据库开发的特权。
但是,我不确定可以用于user_liquibase
的哪个预定义角色可以允许我创建
和/或删除
数据库对象。我希望像user_rw
一样配置user_liquibase
,为其授予pg_read_all_data
和pg_write_all_data
权限,但我缺少执行这些任务所需的其他权限。
有人能提供一个用于实现这一目标的预定义角色吗?
由于我更多地从事开发工作,对这些任务不太熟悉,但这次我也需要设置实例。
英文:
I am in the process of setting up an AWS Aurora (PostgreSQL) 15.x
instance for a Java-based application. I only have access to the instance through the rds_superuser
account — not psql
.
I am configuring three login roles initially:
- A read-only
user_ro
login role — based onpg_read_all_data
. - A read/write
user_rw
login role — based onpg_read_all_data
andpg_write_all_data
. - A
user_liquibase
login role with privileges to automate database development by doing schema changes, seed data.
However, I'm unsure of what predefined role I can use for user_liquibase
that allows me to create
and/or drop
database objects. I would prefer to configure user_liquibase
like user_rw
by granting it pg_read_all_data
and pg_write_all_data
privileges, but I'm missing the rest of the privileges necessary for these tasks.
Can anyone suggest a predefined role to accomplish this?
> I am not familiar with these tasks as I am more on the development side, but this time I need to set up the instance as well.
答案1
得分: 1
pg_write_all_data
允许您对所有现有表执行 INSERT
、UPDATE
和 DELETE
操作。
要创建一个对象,您需要在创建对象的模式上具有 CREATE
权限。
要删除一个对象,您必须是该对象的所有者或拥有该对象的角色的成员。
英文:
pg_write_all_data
allows you to INSERT
, UPDATE
and DELETE
on all existing tables.
To create an object, you need to have the CREATE
privilege on the schema where you create the object.
To drop an object, you must be the owner of the object or a member of the owning role.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论