Extension

A package of code and SQL objects to extend PostgreSQL functionality

An extension is a package of code and SQL objects to extend PostgreSQL functionality.

Extension support was introduced in PostgreSQL 9.1.

psql

Available extensions can be listed with the slash command \dx; \dx+ lists each extension and its associated objects. See below for examples.

System catalogue objects

Tables

Views

Functions

  • pg_extension_update_paths()

Contrib modules

Most contrib modules are implemented as extensions.

Suitable existing contrib modules were converted en-mass to extensions in commit 629b3af2.

Change history

Examples

postgres=# \dx
                                     List of installed extensions
        Name        | Version |   Schema   |                        Description
--------------------+---------+------------+-----------------------------------------------------------
 pg_stat_statements | 1.7     | public     | track execution statistics of all SQL statements executed
 plpgsql            | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

postgres=# \dx+
     Objects in extension "pg_stat_statements"
                Object description
---------------------------------------------------
 function pg_stat_statements(boolean)
 function pg_stat_statements_reset(oid,oid,bigint)
 view pg_stat_statements
(3 rows)

      Objects in extension "plpgsql"
            Object description
-------------------------------------------
 function plpgsql_call_handler()
 function plpgsql_inline_handler(internal)
 function plpgsql_validator(oid)
 language plpgsql
(4 rows)

Categories

Contrib module, Extension

See also

CREATE EXTENSION, ALTER EXTENSION, DROP EXTENSION, contrib module, PGXN