PIGSTY

Update

How to update PostgreSQL extensions to newer versions

To update an existing extension, you need to first update the RPM/DEB package with your OS's package manager, then alter the extension to the new version in PostgreSQL with ALTER EXTENSION ... UPDATE.

You can upgrade extension packages with the following commands

pig ext update extname...
yum upgrade extname...
apt upgrade extname...
./pgsql.yml -t pg_ext   # -l cls

All extensions listed in pg_extensions will be upgraded using during the pgsql.yml playbook execution.


Upgrade Packages

Extensions (Package Alias) listed in pg_extensions will be upgraded with pgsql.yml's pg_ext subtask:

~/pigsty
./pgsql.yml -t pg_ext

This playbook will automatically install the latest available version of extension RPM/DEB packages in your current environment. (from built local repo or via Internet directly). You can also upgrade extensions with linux system's yum/apt upgrade command directly, but you need to specify the full package names:

yum upgrade extname...
apt upgrade extname...

Pigsty’s pig cli can also help you with that, without the burden of specifying full package names:

pig ext update extname|pkgalias

Alter Extension

Execute the ALTER EXTENSION ... UPDATE SQL command to update the extension to the new version:

ALTER EXTENSION name UPDATE [ TO new_version ]

If the TO new_version clause is omitted, the extension will be updated to the latest version available.