Question

How can I create a Postgres 16 user that has permission to create tables on an app platform dev database?

I’m trying to figure out how (or if?) I can run Postgres 16 on app platform with a Django application. I’m getting the following error message:

[2024-08-13 11:58:42] psycopg2.errors.InsufficientPrivilege: permission denied for schema public
[2024-08-13 11:58:42] LINE 1: CREATE TABLE "django_migrations" ("id" integer NOT NULL PRIM...

I understand this is because since Postgres 15 the default user doesn’t have permission to create tables, and that the solution should be to login to the database as the admin user and grant those permissions, as described in these posts:

https://www.digitalocean.com/community/questions/permission-denied-for-database-postgres-when-creating-schemas-in-dev-database https://www.digitalocean.com/community/questions/how-to-provide-access-to-a-public-scheme-in-postgresql-15-or-16-using-terraform

However, I can’t seem to find a way to get the admin user information from the dev database in app platform, so I don’t have a way to login and run this. The connection string that is visible from the app settings page is not for the admin user, and when I try to get it from the doctl databases list command or similar the database doesn’t show up anywhere.

Is there a way to do this or is it not possible to use Postgres 15+ on a dev database that needs to create tables anymore?


Submit an answer


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!

Sign In or Sign Up to Answer

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
Animation showing a Droplet being created in the DigitalOcean Cloud console