Setting up PostgreSQL on Arch Linux

• 1 min read

Arch Linux PostgreSQL docs

Install

$ sudo pacman -S postgresql

Setup the data directory

$ sudo -iu postgres
[postgres]$ initdb -D /var/lib/postgres/data

Start postgresql.service

$ systemctl start postgresql.service
$ systemctl enable postgresql.service

Add user

[postgres]$ createuser --interactive

Create db

$ createdb myDatabaseName
🏷  reference , linux , db , mysql