

Postgis | 3.1.4 | public | PostGIS geometry and geography spatial types and functions Plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language Pg_stat_statements | 1.6 | public | track execution statistics of all SQL statements executed +-+-+-įuzzystrmatch | 1.1 | public | determine similarities and distance between strings The following have been tested on Centos 7 and Ubuntu Focal (20.04.1): $ /usr/pgsql-11/bin/postgres -version In this setup, I used ClusterControl to deploy a PostgreSQL 11 database cluster for a single node. Pg_upgrade supports upgrades from 8.4.X and later to the current major release of PostgreSQL, including snapshot and beta releases. It is also important that any external modules are binary compatible, though this cannot be checked by pg_upgrade. Pg_upgrade does its best to make sure the old and new clusters are binary-compatible, e.g., by checking for compatible compile-time settings, including 32/64-bit binaries. In that case, pg_upgrade supports the -k or –link option, which means it will use hard links instead of copying files to the new cluster. For newer versions of PostgreSQL, such as PG 14.0, you can only take a dump/restore (or export/import) or logical replication, otherwise use pg_upgrade.įor larger datasets, using pg_upgrade requires you to run this on the same host, which by default applies a copy of all your physical files from your data directory. In that case, you might consider using pg_dump/pg_restore, but it can take some time to finish depending on how large your data is. It does have its limitations or caveats, such as the known Unicode or character sets stored in your dataset.

Well, this tool has been widely used elsewhere from QA, to dev, to production environments. Some may consider pg_upgrade to be dangerous, especially for the production environment.

(The community will attempt to avoid such situations.) If a future major release ever changes the data storage format in a way that makes the old data format unreadable, pg_upgrade will not be usable for such upgrades. pg_upgrade uses this fact to perform rapid upgrades by creating new system tables and simply reusing the old user data files. PostgreSQL, especially for major version releases, is known to have new features added that often change the layout of the system tables, but the internal data storage format rarely changes. This works without needing a data dump/reload, which can take some time if you have a big dataset. When upgrading your PostgreSQL to a major version with pg_upgrade, the tool works by allowing the data stored in PostgreSQL data files to be upgraded to a later PostgreSQL major version. Using this tool is not required for minor version upgrades, which means that upgrading your current version of 11.9 to 11.13 is not necessary. Pg_upgrade has been around for a very long time as a tool for upgrading major versions of PostgreSQL. In this blog, we’ll walk through an example of this challenge while having a TimescaleDB and PostGIS installed on an existing PostgreSQL 11 host. PostgreSQL does not lock you up on a specific version to use. If you are facing this type of problem, don’t worry. Upgrading PostgreSQL comes with a few challenges as it’s not as easy compared to other mainstream databases. Some of the main reasons for this are to take advantage of its critical enhancements to its built-in functionalities, security updates, performance improvements, and new implementations beneficial for database management. There are many reasons why upgrading to the latest version is a must. Businesses and enterprises using old versions of PostgreSQL (PG) face challenges when upgrading to at least the most recent stable version from PostgreSQL 12 or PostgreSQL 13.
