PostgreSQL has brought the changes related to a public scheme.
PUBLIC
creation permission on the public
schema (Noah Misch)public
schema to be the new pg_database_owner
role (Noah Misch)The question is how to create a user using resource digitalocean_database_user to be belong to the new role?
I have tested on 16 and have not found such role.
luckyroot=> \du
List of roles
Role name | Attributes | Member of
---------------------+------------------------------------------------------------+-----------------------------------------------------------
_doadmin_managed | Cannot login | {pg_read_all_stats,pg_stat_scan_tables,pg_signal_backend}
_doadmin_monitor | | {pg_monitor}
_dodb | Superuser, Replication | {}
doadmin | Create role, Create DB, Replication, Bypass RLS | {_doadmin_managed,luckyroot-develop-3}
luckyroot-develop-3 | | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hey!
Any new users created with digitalocean_database_user
resource or manually via the DigitalOcean Control Panel, will always have normal
role, only the default user that comes with database cluster creation has primary
role.
Additional permissions must be managed manually.
You can either do it manually as described here:
https://docs.digitalocean.com/products/databases/postgresql/how-to/modify-user-privileges/
Or you could use the Postgres Terraform provider instead:
https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs
Hope that this helps!
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.