pg_extension_update_paths()

A function returning the available updates for each extension version

pg_extension_update_paths() is a system function for retrieving the available update paths between extension versions.

pg_extension_update_paths() was added in PostgreSQL 9.1.

Usage

pg_extension_update_paths ( name name, OUT source text, OUT target text, OUT path text ) → SETOF record

The output shows each combination of extension versions, and the combination of extension scripts which would be executed when using ALTER EXTENSION ... UPDATE to upgrade between one extension version and another. See the Examples section for further details.

Note that extension downgrading is theoretically also supported, although in practice this is rarely available.

Change history

Examples

Usage example for pg_extension_update_paths():

postgres=# SELECT * FROM pg_extension_update_paths('pg_stat_statements')
            WHERE source='1.3'
           ORDER BY target;
 source |   target   |          path           
--------+------------+-------------------------
 1.3    | 1.0        | 
 1.3    | 1.1        | 
 1.3    | 1.2        | 
 1.3    | 1.4        | 1.3--1.4
 1.3    | 1.5        | 1.3--1.4--1.5
 1.3    | 1.6        | 1.3--1.4--1.5--1.6
 1.3    | 1.7        | 1.3--1.4--1.5--1.6--1.7
 1.3    | unpackaged | 
(8 rows)

The output lists the available pg_stat_statements versions, and the combination of extension scripts which would be executed when upgrading from the source version (here: 1.3) to the target version. Where path is empty (NULL), an upgrade is not possible. From the example output, it is not possible to downgrade pg_stat_statements to a lower version.

Categories

Extension, System function

See also

pg_available_extensions, pg_available_extension_versions, pg_extension, extension,