One-click installation of PostgreSQL package

Download link: https://www.postgresql.org/download/Click
Insert image description here
on the corresponding operating system, and then you will enter different pages.
If it is a Windows system or a Mac system, you may enter a new page and click the link in the box:
Insert image description here
Taking Windows as an example, after downloading the installation package, click Run directly, and then keep clicking Next.
Insert image description here
Note that it is recommended to select all tools here, including command line tools and graphical interfaces. If you do not select pgAdmin4, it does not include graphical interfaces and only includes command line tools.
Insert image description here
If it is a Linux system, you will be asked to specifically choose between Ubuntu, Debian, etc. If you click on it, there will be step-by-step prompts. Generally, you can use the command line. Take Ubuntu as an example:

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 --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql

Debian

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 --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql

Centos

sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql14-server
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
sudo systemctl enable postgresql-14
sudo systemctl start postgresql-14

If you want to install through source code, please read this article:
PostgreSQL source code learning - win10 source code compilation and installation.
If you want to install through source code in a non-Windows environment, please read this article:
PostgreSQL official documentation

Guess you like

Origin blog.csdn.net/weixin_43997331/article/details/124133724