I am using a Raspberry Pi 4 running the latest version of Raspberry Pi OS Lite. I installed PostgreSql using
sudo apt-get -y install postgresql