sudo pacman -R postgresql postgresql-libssudo rm -rfv /var/lib/postgressudo pacman -S postgresql postgresql-libssudo passwd postgressudo vim /usr/lib/systemd/system/rc-local.service[Unit]
Description=/etc/rc.local compatibility
[Service]
Type=oneshot
ExecStart=/etc/rc.local
RemainAfterExit=yes
[Install]
WantedBy=multi-user.targetsudo vim /etc/rc.local#!/bin/sh -e
#
# rc.local
exit 0sudo chmod +x /etc/rc.localsudo systemctl enable rc-local.servicesudo su - postgres initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'
exitsudo systemctl start postgresql.serviceYou can run that with the follwing command
psql -U postgresThis won't ask for the password but you can force that wit -W option like
psql -U postgres -W However, you can also pass the -d option to connect directly with database mentioned like psql -U username -d dbname.
๐ Hope this helps you ๐