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 Postgres Database

Creating a postgres database can be done from the command line with:

Code

createdb new_database_name

vai: https://www.postgresql.org/docs/current/tutorial-createdb.html

Old Notes

Connect to the main `postgres` database with a user that has create database privileges via:

Code

psql -U user_name -d postgres

(Or, `psql postgres` if your setup for that)

Run:

Code

CREATE DATABASE your_database_name;

The database is made from a clone of the `template1` database. So, any changes made there will show up in your new database.

NOTES:

You can check what permissions users have with `\du` when logged into the database