Every extension is managed at a database level, meaning that every database that needs an extension must manage such an extension life cycle. In other words, there is not a per-cluster way of managing an extension and applying it to every database within the cluster.
Extensions are mainly managed by means of three SQL statements: CREATE EXTENSION, DROP EXTENSION, and ALTER EXTENSION, to respectively install an extension in a database, remove the extension from the database, and modify extension attributes or upgrade them.
Every extension is specified by a mnemonic and a version; if a version is not specified, PostgreSQL assumes you want to deal with the latest available version or the one that is already installed.
In the following subsections, each of the three management statements will be explained.
Creating an extension
The CREATE EXTENSION statement allows you to install an existing extension into the current database.
The synopsis of the statement is as follows...