Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license CC4-BY
posted in category Systems Software / Postgres
posted at 30. Mar '22

Basic Postgres Database setup

Just a bunch of commands to create user, database and privileges in PostgreSQL.

postgres=# CREATE USER oni_sorceress WITH ENCRYPTED PASSWORD 'my password';
postgres=# CREATE DATABASE plausible_prod;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE plausible_prod TO oni_sorceress;
GRANT
postgres=# CREATE EXTENSION IF NOT EXISTS citext;
CREATE EXTENSION
postgres=# ALTER USER oni_sorceress WITH SUPERUSER;
ALTER ROLE
postgres=# ALTER USER oni_sorceress NOSUPERUSER;
ALTER ROLE
postgres=# 

Add Comment