Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Create A Schema In Postgres

Basic schema creation for a role that has the permissions.

Code

CREATE SCHEMA IF NOT EXISTS new_schema_name;

To set the owner of a new schema to another role, use:

Code

CREATE SCHEMA IF NOT EXISTS new_schema_name AUTHORIZATION role_name;

Full details are in the docs if you need them.