Skip to main content

PostgreSQL extensions

You can add extensions to databases PostgreSQL. Extensions allow you to add functionality to a database without changing the source code of the DBMS itself.

For a list of extensions available in Managed Databases, see the Extension description table.

Some extensions require connecting a public library.

Some extensions depend on others—dependent extensions will not work without the main extension. For a list of dependent and main extensions, see the Dependent extensions table.

You can add an extension in the dashboard, through the Managed Databases API, or through Terraform.

Connect public libraries for extensions

Some extensions require connecting public libraries. To connect a library, when creating a cluster or changing settings in an existing cluster, specify its name in the shared_preload_libraries setting.

In cluster PostgreSQL the following libraries are supported:

  • pg_cron — for the pg_cron extension;

  • pg_prewarm — for the pg_prewarm extension.

Add extension

Extensions are connected separately to each database. If you connect a dependent extension and the main extension is not yet connected, the main extension will be connected automatically first, followed by the dependent one.

  1. In the Dashboard, on the top menu, click Products and select Managed Databases.
  2. Open the Active tab.
  3. Open the cluster page → Databases tab → database card.
  4. In the Extensions block, click Add extension.
  5. Select an extension. For a list of available extensions and their descriptions, see the Extension description table.
  6. Click Add.

Delete extension

A dependent extension can be deleted separately. To delete the main extension, first delete the dependent one. For a list of dependent and main extensions, see the Dependent extensions table.

  1. In the Dashboard, on the top menu, click Products and select Managed Databases.
  2. Open the Active tab.
  3. Open the cluster page → Databases tab → database card.
  4. In the Extensions block, click the extension row.

Extension description

address_standardizerUsed for structuring postal addresses transmitted as a string
address_standardizer_data_usUsed to structure US and Canadian postal addresses for the address_standardizer extension
autoinc

Contains the autoinc() function. This function returns the next value for a sequence stored in an integer field. Unlike built-in sequence management types, autoinc():

  • blocks attempts to insert a value from a query into the field;
  • allows changing the value in the field when updating a record
bloomAdds access to database indexes based on Bloom filters, which require significantly less memory than hash tables but allow for false positives
btree_ginContains examples of the GIN (Generalized Inverted Index) operator class, used for reverse searching
btree_gistContains GiST (Generalized Search Tree) operator classes. Unlike B-tree indexes, GiST supports the <> (not equal) and <-> (distance) operators, although it does not guarantee uniqueness of returned values
citextContains the citext data type, which is used for case-insensitive string operations
clickhouse_fdw

Allows connecting directly from a PostgreSQL cluster to ClickHouse databases using a Foreign Data Wrapper.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users.

The extension is available for PostgreSQL versions 15 and higher

cubeContains the cube data type, which is used to represent multidimensional cubes
dblinkSupports connecting from the current session to other PostgreSQL databases
dict_intContains an example of an additional dictionary template for full-text search, which can help prevent the list of unique words from growing and increase search speed
dict_xsynContains an example of an Extended Synonym Dictionary template for full-text search: when searching for a word, all its synonyms will be found
fuzzystrmatchContains functions used for determining string similarity and difference
h3-pg

Provides an API to H3, an open system for indexing geographic objects in a grid of hexagonal zones (tiles). It allows dividing territory into identical tiles for geospatial analysis, such as building heatmaps or analyzing traffic and mobility. Can be used together with PostGIS for advanced geospatial analysis.

The extension is available for PostgreSQL versions 15 and higher

hstoreContains the hstore type, which allows storing key/value pairs in a single table field and working with them efficiently
intarrayContains functions and operators for working with integer arrays that do not contain empty (NULL) values
ip4rSupports indexing of IPv4 and IPv6 addresses to improve query performance
isnContains data types for international product numbering standards EAN13, UPC, ISBN, ISMN, and ISSN. Number validation and formatting are performed according to a specified list of prefixes
jsonb_plperl

Adds support for json and jsonb data types to the PL/Perl procedural language. Allows direct use of JSON data when writing functions and triggers in Perl

jsqueryAllows using the JsQuery language for working with jsonb data. JsQuery allows organizing efficient searches in nested objects and contains additional comparison operators with index support
loContains the lo data type and the lo_manage() function, which are used to manage Binary Large Objects (BLOBs) in accordance with the requirements of JDBC and ODBC driver specifications (standard PostgreSQL behavior does not correspond to them)
ltreeContains the ltree data type for representing data labels stored in a tree-like hierarchical structure
moddatetimeContains the moddatetime() function, which allows tracking the last modification time of a table row
mysql_fdw

Allows connecting directly from a PostgreSQL cluster to MySQL databases using a Foreign Data Wrapper.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users.

The extension is available for PostgreSQL versions 15 and higher

oracle_fdw

Allows connecting directly from a PostgreSQL cluster to Oracle databases using a Foreign Data Wrapper.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users.

The extension is available for PostgreSQL versions 15 and higher

pg_buffercache

Allows monitoring the state of the shared buffer cache in real time.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users.

The extension is available for PostgreSQL versions 15 and higher

pg_cron

Allows for the scheduling of SQL queries within a database.

Requires connecting a shared library pg_cron.

The extension can be connected to only one database in a cluster. To connect the extension to another database, first delete it from the current one.

Connecting this extension will cause the cluster to restart.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users.

The extension is available for PostgreSQL versions 15 and higher

pg_prewarm

Allows loading relation data into the operating system cache or the PostgreSQL buffer cache.

Requires connecting a shared library pg_prewarm.

Connecting this extension will cause the cluster to restart.

The extension is available for PostgreSQL versions 15 and higher

pg_repack

Allows rebuilding tables and indexes without blocking, in order to reduce their size and fragmentation.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users

pg_stat_statements

Adds capabilities for tracking planning and collecting execution statistics for all SQL queries run in the cluster.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users

pg_trgm

Contains tools for quickly finding similar strings based on trigram matching.

The extension is available for PostgreSQL versions 15 and higher

pg_uuidv7

Contains functions for generating UUID version 7.

The extension is available for PostgreSQL versions 15 and higher

pgcryptoProvides a set of cryptographic functions for data protection. Learn more about data encryption using the pgcrypto extension and usage examples in the Data Encryption guide
pgrowlocksContains the pgrowlocks() function, which returns information about row locks in the specified table
pgstattuple

Provides detailed statistics on disk space usage and allows analyzing index fragmentation, the number of dead tuples, and free space. The extension is useful for performance diagnostics, index optimization, planning VACUUM operations, and using the pg_repack extension

pgTAPProvides a set of tools for testing database schemas and SQL functions
plpgsql

Allows using the PL/pgSQL procedural language for creating functions, procedures, and triggers. This extension is enabled by default and is automatically available in all databases created in the cluster. It does not need to be connected separately via the dashboard

plv8Allows using JavaScript for writing stored procedures and triggers
postgis

Allows storing and processing geographic information system (GIS) objects in PostgreSQL databases.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users

postgis_rasterAllows working with raster images and conducting analysis for geographic information systems (GIS) in databases
postgres_fdw

Allows connecting directly from a PostgreSQL cluster to data stored on external servers (other PostgreSQL clusters) using a Foreign Data Wrapper.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users

prefixAllows using prefixes and masks to optimize queries
rumAdds an access method for working with RUM indexes
segContains the seg data type for representing line segments or floating-point intervals
tablefuncContains a set of functions that return tables (row sets)
tcn

Provides a trigger function for creating notifications about changes in tables to which the trigger is attached.

The extension is available for PostgreSQL versions 15 and higher

tsm_system_rows

Provides a sampling method by row count (SYSTEM_ROWS), which can be used in the TABLESAMPLE clause of a SELECT command.

The extension is available for PostgreSQL versions 15 and higher

tsm_system_time

Provides a sampling method by execution time (SYSTEM_TIME), which can be used in the TABLESAMPLE clause of a SELECT command.

The extension is available for PostgreSQL versions 15 and higher

unaccentContains a dictionary for searching text without regard to diacritical marks
uuid-osspContains functions for generating UUIDs according to standard algorithms
vectorAllows working with vector data—storing, indexing, and executing queries
xml2Allows using XPath queries and the XSLT language

Dependent extensions

earthdistanceContains a module for calculating distances between points on the Earth's surface. Works only together with the main cube extension
pg_stat_kcache

Adds the ability to collect statistics on read and write operations performed at the file system level. Works only together with the main pg_stat_statements. extension.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users

pgroutingContains functions for geospatial routing of the PostGIS database. Works only together with the main postgis extension
postgis_tiger_geocoderContains functions for geocoding based on TIGER format data. Works only together with the main postgis extension
postgis_topology

Contains data types and functions of the postgis extension for managing topological objects. Works only together with the main postgis. extension.

Using this extension requires the dbaas_admin role. This role is automatically granted to the database owner and cannot be assigned to other users