Managing extensions
Managed Service for PostgreSQL supports multiple standard PostgreSQL extensions, along with several custom ones. A complete list of available extensions and their versions for each PostgreSQL release is provided below.
Warning
Managed Service for PostgreSQL clusters do not support managing PostgreSQL extensions via SQL commands.
Loading libraries for extensions
Some extensions require shared libraries to be loaded. To load a library, specify its name in the Shared preload libraries setting when you create or modify a cluster.
Managed Service for PostgreSQL supports the following libraries:
age: Required for the age extension.anon: Required for the postgresql_anonymizer extension.auto_explain: Required for the auto_explain extension.pg_cron: Required for the pg_cron extension.pg_hint_plan: Required for the pg_hint_plan extension.pg_qualstats: Required for the pg_qualstats extension.pg_stat_query_plans: Required for the pg_stat_query_plans extension.pgaudit: Required for the pgaudit extension.pglogical: Required for the pglogical extension.timescaledb: Required for TimescaleDB to function.
Warning
Loading a shared library will cause PostgreSQL the master host to restart.
Getting a list of loaded extensions
- Navigate to the folder dashboard and select Managed Service for PostgreSQL.
- Click the cluster name and select the Databases section.
- The PostgreSQL extensions column will show the list of extensions loaded for each database.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To get a list of database extensions, run this command:
yc managed-postgresql database get <DB_name> \
--cluster-name <cluster_name>
The extensions list will show the loaded extensions.
-
Get an IAM token for API authentication and place it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Use the Database.Get method to execute the following request via cURL
:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-postgresql/v1/clusters/<cluster_ID>/databases/<DB_name>'You can get the cluster ID from the folder’s cluster list, and the database name from the cluster’s database list.
-
Check the server response to make sure your request was successful.
You can find the list of loaded extensions in the
extensionsfield of the command output.
-
Get an IAM token for API authentication and save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume the repository contents are stored in the
~/cloudapi/directory. -
Use the DatabaseService.Get call to execute the following request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/postgresql/v1/database_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "database_name": "<DB_name>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.postgresql.v1.DatabaseService.GetYou can get the cluster ID from the folder’s cluster list, and the database name from the cluster’s database list.
-
Check the server response to make sure your request was successful.
You can find the list of loaded extensions in the
extensionsfield of the command output.
Updating a list of loaded extensions
- Navigate to the folder dashboard and select Managed Service for PostgreSQL.
- Click the cluster name and select the Databases tab.
- Find the database you need in the list, click
in its row, then select Manage. - Select the extensions you need and click Configure.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To update extensions for a database, provide their list in the --extensions argument of the CLI command. Any extensions not included in the list will be disabled.
yc managed-postgresql database update <DB_name> \
--cluster-name <cluster_name> \
--extensions <extension_name>,<extension_name>...
You may get errors when installing multiple extensions. Learn more about possible causes of errors and how to troubleshoot them in FAQ.
-
Open the current Terraform configuration file describing your infrastructure.
For information on how to create this file, see this guide.
For a complete list of configurable Managed Service for PostgreSQL cluster database settings, refer to the Terraform provider guides.
-
Add one or more
extensionsections to the relevant cluster database configuration, with one section per extension:resource "yandex_mdb_postgresql_database" "<DB_name>" { ... extension { name = "<extension_name>" } ... } -
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
-
Get an IAM token for API authentication and save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Use the Database.Update method to execute the following request via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMaskparameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-postgresql/v1/clusters/<cluster_ID>/databases/<DB_name>' \ --data '{ "updateMask": "extensions", "extensions": [ { "name": "<extension_name>" }, { <similar_configuration_for_extension_2> }, { ... }, { <similar_configuration_for_extension_N> } ] }'Where:
-
updateMask: Comma-separated list of settings you want to update.Here, we provide only one setting.
-
extensions: Array of database extensions. Each object represents a single extension and has the following structure:name: Extension name.
Use a name from the list of supported PostgreSQL extensions and utilities.
You can get the cluster ID from the folder’s cluster list, and the database name from the cluster’s database list.
-
-
Check the server response to make sure your request was successful.
-
Get an IAM token for API authentication and save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume the repository contents are stored in the
~/cloudapi/directory. -
Use the DatabaseService.Update call to execute the following request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_maskparameter as an array ofpaths[]strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/postgresql/v1/database_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "database_name": "<DB_name>", "update_mask": { "paths": [ "extensions" ] }, "extensions": [ { "name": "<extension_name>" }, { <similar_configuration_for_extension_2> }, { ... }, { <similar_configuration_for_extension_N> } ] }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.postgresql.v1.DatabaseService.UpdateWhere:
-
update_mask: List of settings you want to update as an array of strings (paths[]).Here, we provide only one setting.
-
extensions: Array of database extensions. Each array element contains the configuration for a single extension and has the following structure:name: Extension name.
Use a name from the list of supported PostgreSQL extensions and utilities.
You can get the cluster ID from the folder’s cluster list, and the database name from the cluster’s database list.
-
-
Check the server response to make sure your request was successful.
Supported PostgreSQL extensions and utilities
|
Extension \ PostgreSQL version |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
|
Provides functions to normalize postal addresses from string inputs. |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
3.4.3 |
|
Contains normalization rules for the US and Canadian postal addresses to be used with the |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
3.4.3 |
|
Adds support for graph databases
Using this extension requires you to enable the |
- |
- |
- |
- |
- |
1.5.0 |
1.5.0 |
|
Provides functions for validating the logical integrity of a database’s relational schema. To use this extension, you need the |
1.1 |
1.2 |
1.2 |
1.3 |
1.3 |
1.3 |
1.4 |
|
Contains the
|
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
|
Enables access to database indexes based on Bloom filters |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
|
Contains examples of GIN (Generalized Inverted Index) operator classes used for inverted index searches. |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
|
Contains GiST (Generalized Search Tree) operator classes. Unlike a B-tree index, GiST supports the |
1.5 |
1.5 |
1.5 |
1.6 |
1.7 |
1.7 |
1.7 |
|
Contains the |
1.5 |
1.6 |
1.6 |
1.6 |
1.6 |
1.6 |
1.6 |
|
Adds a foreign data wrapper The extension is not supported in PostgreSQL version 16 and above. Use Yandex Data Transfer to import data into a ClickHouse® database. |
1.3 |
1.3 |
1.3 |
1.4 |
1.4 |
- |
- |
|
Contains the |
1.4 |
1.4 |
1.4 |
1.5 |
1.5 |
1.5 |
1.5 |
|
Enables connections to other PostgreSQL databases from within the current session. To use this extension, you need the |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
|
Contains an example of an additional dictionary template for full-text search. This template helps to control the size of the unique word list, which improves search performance. For full-text search, you can also use Hunspell dictionaries alongside the extension. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
|
(Extended Synonym Dictionary) contains an example of an add-on dictionary template for full-text search. It allows searching for a word using any of its synonyms. For full-text search, you can also use Hunspell dictionaries alongside the extension. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
- |
|
Provides a module for calculating distances between geographical points. Distance calculation is performed using two methods:
|
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
|
Provides functions for calculating string similarity and distance. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.2 |
1.2 |
|
Contains the |
1.5 |
1.6 |
1.7 |
1.8 |
1.8 |
1.8 |
1.8 |
|
Contains virtual indexes. Virtual indexes provide a low-cost way to determine whether PostgreSQL will use real indexes for problematic queries. |
1.3.1 |
1.3.1 |
1.3.1 |
1.3.1 |
1.3.1 |
1.4.0 |
1.4.1 |
|
Provides functions and operators for handling integer arrays containing no |
1.2 |
1.2 |
1.3 |
1.5 |
1.5 |
1.5 |
1.5 |
|
Provides data types for international product numbering standards: EAN13, UPC, ISBN, ISMN, and ISSN. Numbers are validated and generated based on a predetermined list of prefixes. |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
|
Adds JsQuery language support for the |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
|
Contains the |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
|
Enables the collection of message statistics from log files. |
- |
- |
- |
- |
- |
- |
2.0 |
|
Contains the |
1.1 |
1.1 |
1.2 |
1.2 |
1.2 |
1.2 |
1.3 |
|
Enables you to retrieve the last LSN (log sequence number) written to the replica’s disk. |
- |
- |
- |
- |
- |
- |
1.0 |
|
Provides the |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
|
Adds a foreign data wrapper To use this extension, you need the |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
|
Provides functions and operators emulating Oracle database functions and packages. |
3.18 |
3.18 |
3.18 |
3.18 |
3.25 |
4.6 |
4.13 |
|
Provides functions for shared buffer cache monitoring. To use this extension, you need the |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.4 |
1.5 |
|
Enables you to schedule database jobs and execute SQL queries directly within them. Requires enabling the To use this extension, you need the Loading this extension will cause all hosts to restart. For more information, see Using pg_cron. |
1.4.1 |
1.4.1 |
1.4.1 |
1.4.1 |
1.4.1 |
1.5 |
1.6 |
|
Provides functions for managing the PostgreSQL planner. Using this extension requires you to enable the |
1.3.4 |
1.3.5 |
1.3.7 |
1.4 |
1.5 |
1.6.0 |
1.7.0 |
|
Adds advanced table partitioning options, including time-based and sequence-based partitioning. |
4.0.0 |
4.2.0 |
4.4.0 |
4.6.0 |
4.7.0 |
4.7.4 |
5.1.0 |
|
Enables loading relation data into the OS cache or the PostgreSQL buffer cache. |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
|
Enables collection of predicate statistics from Using this extension requires you to enable the |
2.0.3 |
2.0.3 |
2.0.3 |
2.0.3 |
2.0.4 |
2.1.0 |
2.1.1 |
|
Provides functions for removing bloat from tables and indexes. Unlike To use this extension, you need the |
1.4.6 |
1.4.6 |
1.4.6 |
1.4.7 |
1.4.8 |
1.4.8 |
1.4.8 |
|
Enables collection of read and write operation statistics at the file system level. Using this utility requires you to enable the To use this extension, you need the |
2.1.1 |
2.1.1 |
2.1.3 |
2.2.0 |
2.2.1 |
2.2.1 |
2.3.0 |
|
Enables you to track SQL query execution statistics and query plans. Using this extension requires you to enable the |
- |
- |
- |
- |
- |
- |
1.0 |
|
Enables you to track the scheduling and collect execution statistics of all SQL queries running in a cluster. To use this extension, you need the |
1.6 |
1.7 |
1.8 |
1.9 |
1.10 |
1.10 |
1.11 |
|
Enables you to create a logical replication slot in the past. |
1.0 |
1.0 |
1.0 |
1.0 |
1.1 |
1.1.1 |
1.1.1 |
|
Provides tools for fast similarity search across strings using trigram matching. |
1.4 |
1.4 |
1.5 |
1.6 |
1.6 |
1.6 |
1.6 |
|
Provides additional logging tools and enhanced auditing capabilities. Using this extension requires you to enable the For more information, see Using pgaudit. |
1.0.0 |
1.0.0 |
1.0.0 |
1.0.0 |
1.7 |
16.0 |
17.0 |
|
Provides cryptographic functions for PostgreSQL. For more information, see Using pgcrypto. |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
|
Adds support for streaming logical replication based on the publish/subscribe model. Using this extension requires you to enable the |
2.4.1 |
2.4.1 |
2.4.1 |
2.4.1 |
2.4.4 |
2.4.4 |
2.4.5 |
|
Provides geospatial routing functions for the PostGIS |
2.6.2 |
2.6.2 |
3.0.2 |
3.3.0 |
3.4.1 |
3.5.0 |
3.6.2 |
|
Contains the |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
|
Provides functions for retrieving tuple-level statistics. To use this extension, you need the |
1.5 |
1.5 |
1.5 |
1.5 |
1.5 |
1.5 |
1.5 |
|
Provides vector similarity search functionality. |
0.2.5 |
0.2.5 |
0.2.5 |
0.2.5 |
0.3.2 |
0.8.0 |
0.8.0 |
|
Adds support for the PL/pgSQL procedural language. |
- |
- |
- |
- |
- |
- |
1.0 |
|
Adds support for the plv8 JavaScript-based procedural language powered by the V8 engine. |
3.0.0 |
3.0.0 |
3.0.0 |
3.0.0 |
- |
3.2.3 |
3.2.3 |
|
Adds capabilities for storing and processing GIS (Geographic Information System) objects in PostgreSQL databases. |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
3.4.3 |
|
Provides functions for geocoding using data in the TIGER |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
3.4.3 |
|
Contains data types and functions of the |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
3.4.3 |
|
Adds a foreign data wrapper To use this extension, you need the |
1.0 |
1.0 |
1.0 |
1.1 |
1.1 |
1.1 |
1.1 |
|
Enables you to mask or substitute data in a PostgreSQL database. Using this extension requires you to enable the For more information, see Using postgresql_anonymizer. To use this extension, you need the |
- |
- |
- |
- |
1.3.2 |
1.3.2 |
1.3.2 |
|
Provides an access method for |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
|
Contains the |
1.3 |
1.3 |
1.3 |
1.4 |
1.4 |
1.4 |
1.4 |
|
Provides functions for calculating array similarity. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
|
Provides functions returning row sets. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
|
Enables automatic table partitioning by time and partition key, while preserving the standard PostgreSQL data interface. This provides the scalability needed to process time-series in PostgreSQL. Using this extension requires you to enable the The service includes TimescaleDB Apache 2 Edition, which offers reduced functionality compared to TimescaleDB Community Edition. You cannot change the edition. For more details on limitations, see the TimescaleDB guides |
2.3.1 |
2.4.2 |
2.5.2 |
2.6.1 |
2.9.0 |
2.20.3 |
2.20.3 |
|
Provides a dictionary for diacritic-insensitive text search. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
|
Provides functions for generating UUIDs according to standard algorithms. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
|
Adds support for Xpath and XSLT. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
The pgcompacttable
Command syntax:
./bin/pgcompacttable \
-h c-<cluster_ID>.rw.mdb.yandexcloud.net \
-p 6432 \
-U <username> \
-W <password> \
-d <DB_name> \
-n <schema_name> \
-t <table_name>
Using this utility requires you to enable the pgstattuple extension.
To use it, you need the mdb_admin role.
ClickHouse® is a registered trademark of ClickHouse, Inc