‹‹

Setting up PostgreSQL on Arch Linux

Oct 15, 2021

Read time: 1 minute

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