PostgreSQL | Getting started
Install
PostgreSQL Server
Mac OS
brew install postgres
Windows (Installer)
Windows (Zip-ARchiv)
Download postgresql from https://www.enterprisedb.com/download-postgresql-binaries
Configure
Initialize database:
initdb.exe -D ../data –-username=postgres –-auth=trust
Start the database:
pg_ctl.exe start -D ../data
Log into the database:
psql –-username=postgres
Create a password for your user:
ALTER USER postgres WITH PASSWORD ‘VeryVerySecret’;
Install adminpack extension:
CREATE EXTENSION adminpack;
Manage Users
Preparation
psql postgres
List all Users
postgres=# \du+
Create Superuser
create role superuser superuser login password 'pAssw8rd';
Change Password
Postgres Utilities
Documentation
- Upgrade
- Migrate existing data from a previous minor version (9.0-9.5) of PostgreSQL
- PostgreSQL command line cheatsheet (github.com)