Create Postgres database
11 March 2022 (Updated 8 April 2022)
The createdb
command requires that the executing user has the privilege to create new databases. The default postgres
superuser should have this privilege so you might want to run sudo su - postgres
before the subsequent commands.
Create database and make executing user its owner
createdb <database>
Create database with specific owner
createdb <database> -O <some-postgres-user>
Sources
Tagged:
Postgres
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment