Report this

What is the reason for this report?

I’m using DigitalOcean App Platform and have a dev database with PostgreSQL 17 set up. As part of my planning, I’d like to create a separate schema to attain fine-grained access control.

I’m able to connect to my database using “psql” through the console of my web service.

my-db=> CREATE SCHEMA private;
ERROR:  permission denied for database my-db

I can only assume the user provided by DO does not have the permission to create a schema and I seem to be unable to grant it as well:

my-db=> GRANT CREATE ON DATABASE "my-db" TO "my-db";
WARNING:  no privileges were granted for "my-db"
GRANT

Is there anything that can be done about this?

Running \l shows that the owner of the database is doadmin, but I have not been giving the credentials for that user.



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

I answered a similar question a few months ago here:

https://www.digitalocean.com/community/questions/how-to-create-tables-with-app-platform-managed-dev-databases

The issue is that Dev Databases don’t allow creating new databases or schemas, you have to use the default database and the public schema.

If you need to create your own extra schemas, it’s better to spin up a full Managed Database cluster instead of a Dev Database. That way, you’ll have full rights to create as many schemas as you need.

https://docs.digitalocean.com/products/databases/postgresql/

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.