By mateust
I was able to successfully connect to my app’s dev database, however when I try to create a schema with this script:
client.query(
`CREATE SCHEMA IF NOT EXISTS ${team};`, (err, res) => {
if (err) console.log(err.stack);
});
I get the following error:
digitalocean app error: permission denied for database db
I understand that the dev database doesn’t allow me to create databases, but nothing is said about creating schemas which is what I tried to do. It turns out that the default user db doesn’t have that privilege and it seems that there’s no way for me to change it.
What are the default user permissions? Should I be allowed to create PostgreSQL schemas in the dev database? This is what I get, and it looks like the user I have access to has no permissions whatsoever.
| Role name | Attributes | Member of |
|---|---|---|
| _dodb | Superuser, Replication | {} |
| db | {} | |
| doadmin | Create role, Create DB, Replication, Bypass RLS | {db} |
| 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!
I am also experiencing this issue, and it’s preventing me from moving forward with a project; I’d love to use hosted Postgres instead of maintaining my own, but I need multiple schema to do it.
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.