install postgresql 11 in ubununt code example
Example 1: install postgres 11 ubuntu
sudo apt update && sudo apt -y upgrade
wget
RELEASE=$(lsb_release -cs)
echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list
cat /etc/apt/sources.list.d/pgdg.list
sudo apt update
sudo apt -y install postgresql-11
sudo -u postgres psql
postgres=
postgres=
postgres=
postgres=
Example 2: ubuntu install postgresql 12
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget
sudo apt-get update
sudo apt-get -y install postgresql