loading...
Cover image for How to install PostgreSQL in Manjaro Linux

How to install PostgreSQL in Manjaro Linux

lobo_tuerto profile image Víctor Adrián Originally published at lobotuerto.com on ・1 min read

Installation process

Setting up PostgreSQL in Manjaro Linux is very easy.

Just follow these steps and you’ll have a working installation in no time.

Install the postgresql package:

sudo pacman -S postgresql

Then setup a password for the postgres user with:

sudo passwd postgres

Switch to the postgres user account and initialize the database cluster:

sudo su postgres -l # or sudo -u postgres -i
initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/'
exit

Options for initdb are as follows:

  • --locale is the one defined in /etc/locale.conf.
  • -E is the default encoding for new databases.
  • -D is the default location for storing the database cluster.

Now, start and enable the postgresql.service:

sudo systemctl enable --now postgresql.service

That’s it!

Links

Posted on by:

lobo_tuerto profile

Víctor Adrián

@lobo_tuerto

Fullstack Developer — Specializing Generalist — UI Engineering ⚫ Elixir, Phoenix, Javascript, Vue.js, Material Design, D3, HTML, CSS ⚫ Gamedev/VR/ComputerArt hobbyist ⚫ Aspiring Zen Buddhist

Discussion

markdown guide