Checking for available extensions

PostgreSQL offers various views to figure out which extensions are on the system and which ones are actually deployed. One of those views is pg_available_extensions:

test=# \h CREATE EXTENSION Command: CREATE EXTENSIONDescription: install an extensionSyntax:CREATE EXTENSION [ IF NOT EXISTS ] extension_name    [ WITH ] [ SCHEMA schema_name ]             [ VERSION version ]             [ FROM old_version ]             [ CASCADE ]

It contains a list of all of the extensions that are available, including their names, their default version, and the version that's currently installed. To make it easier for the end user, there is also a description available, telling us more about the extension.

The following listing contains two lines taken from pg_available_extensions ...

Get Mastering PostgreSQL 11 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.