Skip to content

Instantly share code, notes, and snippets.

@andrewp-as-is
Created June 17, 2020 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewp-as-is/0b7f73f6d3ea73b5179fb0200db3fae7 to your computer and use it in GitHub Desktop.
Save andrewp-as-is/0b7f73f6d3ea73b5179fb0200db3fae7 to your computer and use it in GitHub Desktop.
PostgreSQL user
--sudo -u postgres psql -p 5432
CREATE USER username WITH PASSWORD 'secret';
ALTER USER username WITH PASSWORD 'secret';
DROP USER username;
CREATE DATABASE dbname WITH OWNER=username;
GRANT ALL PRIVILEGES ON DATABASE "dbname" to username;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment