- Symptom
- ERROR: permission denied for schema publicCREATE TABLE works as the database owner or a superuser but not as the app roleThe same migration succeeds against a PostgreSQL 14 server
- Cause
- PostgreSQL 15 removed the default CREATE privilege for PUBLIC on the public schema in new clusters and new databases, and made pg_database_owner its owner. Upgraded clusters and restored dumps keep the old grants, so environments disagree.
- Fix
- Make the app role own the database, or grant CREATE on the schema to it explicitly.
- Apply
ALTER DATABASE app OWNER TO app_user; -- or GRANT USAGE, CREATE ON SCHEMA public TO app_user;- Affected
- PostgreSQL 15 and later (October 2022), new clusters and newly created databases
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders