Installation of PostgreSQL Database in Arch Linux

  1. Install the package postgresql
pacman -S postgresql
  1. Installation also adds a new user called postgres to the system. Ensure this by running the following command
cat /etc/passwd
  1. Set password for the user postgres
sudo passwd postgres
  1. Login to postgres user
su postgres
  1. Initiate DB
initdb -D /var/lib/postgres/data --data-checksums

You CANNOT use a sub-directory under your $USER home directory as postgres directory afaik.

  1. Start PostgreSQL service by running
systemctl start postgresql.service
© 2019 - 2024 · Home ยท Theme Simpleness Powered by Hugo ·