My Software Engineering Notes Help

Manjaro PostgreSQL

manajaro-logo

Install PostgreSQL

  1. Install

sudo pacman -S yay # if not already installed yay postgresql pgadmin4
  1. Setup posgresql service

sudo -u postgres -i # login as postgres initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/' sudo systemctl enable --now postgresql sudo systemctl status PostgreSQL # check for any errors
  1. Setup password

psql -U postgres postgres = # \password # to set password
  1. Setup connection security

su cd /var/lib/postgres/data cp pg_hba.conf pg_hba.conf.backup nano pg_hba.conf

Seed a Database

  • login as postgres

sudo -u postgres -i
  • cd to working/project directory

cd [folder]
  • seed database

psql < filename.sql
Last modified: 10 March 2024