sajad torkamani

Create the file repository config

sudo sh -c 'echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Import the repository signing key

wget --quiet -O - | sudo apt-key add - 

Update the package lists

sudo apt-get update 

Install package

Check the release notes for available versions.

Assuming, you want to install version 14, run:

sudo apt-get -y install postgresql-14

Access psql prompt

Test everything is setup by connecting to the psql prompt.

sudo -u postgres psql

Refer to How do postgres roles work for more info on how access can be configured.


Tagged: Postgres