Ubuntu18.04 Install Postgres 12 Database

Postgresql 12 has many new features, but the key point is that SQL backup files from Postgresql 12 cannot be directly imported into Postgresql 10 using the psql command.

Ubuntu18.04 Install Postgres 12 Database

Why install PostgreSQL 12

PostgreSQL 12 has many new features, but the key point is that SQL backup files from PostgreSQL 12 cannot be directly imported into PostgreSQL 10 using the psql command.
The default installation method on Ubuntu 18.04, apt install postgresql, installs PostgreSQL 10, which can cause some trouble when restoring the database.
Therefore, it is best to install PostgreSQL 12 directly in one step.
On Ubuntu 20.04, using apt install postgresql installs PostgreSQL 12 by default.

Installation command

# Add PostgreSQL source to system sources
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

# Add signing key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

# Update package list
# Before this, you can replace the software sources with domestic ones
sudo apt-get update

# Install the latest version of PostgreSQL
# To specify a version, use a command like postgresql-12 (postgresql-version number):
sudo apt-get install postgresql

关于我们

​我们致力于帮助中小企业实现数字化转型,我们的团队由一群充满激情和创新思维的专业人士组成,他们具备丰富的行业经验和技术专长。

扫一扫获取顾问以及手册

归档
Sign in to leave a comment
Solution for Odoo XLS Report Download Server Internal Error