Home Blog Links Now

Setting up PostgreSQL on Arch Linux

2021-10-10 reference linux db mysql

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