Step 1 – Install PostgreSQL 14 on Debian 11 | Debian 10
PostgreSQL is available in the default Debian repositories but the available versions are not up to date. Check the available versions using the command:
sudo apt-cache search postgresql | grep postgresql
In this guide, we are interested in PostgreSQL 14 which is not provided in the default repositories. Therefore, we are required to add a repository that provides the package.
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
Import the GPG key for the added repository.
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Next, update your APT package index.
sudo apt -y update
Tulisan ini saya copy dari sumber website: https://computingforgeeks.com/how-to-install-postgresql-14-on-debian/
Langkah yang dilakukan adalah sebagai berikut:
Now install PostgreSQL 14 on Debian 11/Debian 10 using the command below.
sudo apt install postgresql-14
Verify your PostgreSQL 14 installation as below.
$ sudo -u postgres psql -c "SELECT version();"
version
-----------------------------------------------------------------------------------------------------------------------------
PostgreSQL 14.8 (Debian 14.8-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
With a complete installation, PostgreSQL 14 will be initialized. Check the status of the service as below.
$ systemctl status postgresql
Referensi:
https://computingforgeeks.com/best-books-to-learn-postgresql-database/
https://computingforgeeks.com/how-to-install-postgis-on-ubuntu-linux/
https://zonabiner.com/install-postgresql-ubuntu-20-04
https://askubuntu.com/questions/1010442/how-to-uninstall-the-postgresql