CLI Notes for PostgreSQL

psql Use

To get to administrator prompt:

sudo su -
su - postgres

DB Access

Give user access to the database from IP address by editing file:

sudo -u postgres vi /etc/postgresql/9.4/main/pg_hba.conf

Add line:

hostssl fireflyd  firefly md5

The line above allows firefly user to connect to fireflyd database from IP address. Subnet /31 points to only one IP address.

Reload configuration with:

sudo -u postgres psql
select pg_reload_conf();


systemctl status postgresql


Install on Manjaro:

pacman -Sy postgresql


Client Tools on Windows

Download standalone build of PostgreSQL and extract client tools bin directory.