Skip to content

Instantly share code, notes, and snippets.

@lysender
Created June 20, 2025 12:35
Show Gist options
  • Save lysender/603e4ae3f94467e309e95b942107eb4a to your computer and use it in GitHub Desktop.
Save lysender/603e4ae3f94467e309e95b942107eb4a to your computer and use it in GitHub Desktop.
PostgreSQL create user

PostgreSQL - create user

Login first using the superuser account:

psql -h 127.0.0.1 -p 54320 -U postgres -W

Create your dev user:

CREATE USER shanks WITH PASSWORD 'password' SUPERUSER;

Bonus: create a database

CREATE DATABASE redhair;

Connect after creating a database:

psql -h 127.0.0.1 -p 54320 -U shanks -W -d redhair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment