Managing extensions
Managed Service for PostgreSQL supports many standard and some non-standard PostgreSQL extensions. A complete list of available extensions and versions based on the PostgreSQL version is provided below.
Warning
In Managed Service for PostgreSQL clusters, you cannot manage PostgreSQL extensions using SQL commands.
Enabling libraries for extensions
For some extensions, you need to enable shared libraries. To link a library when creating or editing a cluster, specify its name in the Shared preload libraries parameter.
You can install the following libraries in Managed Service for PostgreSQL:
auto_explain
: Required for the auto_explain extension to function.pgaudit
: Required for the pgaudit extension to function.pg_cron
: Required for the pg_cron extension to function.pg_hint_plan
: Required for the pg_hint_plan extension to function.pg_qualstats
: Required for the pg_qualstats extension to function.timescaledb
: Required to use the TimescaleDB extension .
Warning
Enabling a shared library will cause PostgreSQL to restart on the master host.
Retrieving a list of installed extensions
- Go to the folder page and select Managed Service for PostgreSQL.
- Click the cluster name and select the Databases section.
- In the PostgreSQL extensions column, you will see a list of extensions enabled for each database.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of extensions for a database, run the command:
yc managed-postgresql database get <DB_name> \
--cluster-name <cluster_name>
The extensions
list will show the enabled extensions.
-
Get an IAM token for API authentication and place it in the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Database.get method and make a request, e.g., 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 with a list of clusters in your folder, and the DB name with the list of databases in your cluster.
-
View the server response to make sure the request was successful.
You can see the list of installed extensions in the
extensions
parameter of the command output.
-
Get an IAM token for API authentication and place it in the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the DatabaseService/Get call and make a 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.Get
You can get the cluster ID with a list of clusters in your folder, and the DB name with the list of databases in your cluster.
-
View the server response to make sure the request was successful.
You can see the list of installed extensions in the
extensions
parameter of the command output.
Editing a list of installed extensions
- Go to the folder page and select Managed Service for PostgreSQL.
- Click the cluster name and open the Databases tab.
- In the row with the DB you need, click
and select Manage. - Select the extensions you need and click Configure.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder 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. The extensions that are not on the list will be disabled.
yc managed-postgresql database update <DB_name> \
--cluster-name <cluster_name>
--extensions <extension_name>=<version>,<extension_name>=<version>...
Note
The extension version is not considered when handling the command: you can pass any non-empty string as a version.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating clusters.
For a complete list of editable Managed Service for PostgreSQL cluster database configuration fields, see the Terraform provider documentation
. -
Add one or more
extension
sections (one section for each extension) to the description of the appropriate cluster database:resource "yandex_mdb_postgresql_database" "<DB_name>" { ... extension { name = "<extension_name>" version = "<extension_version>" } ... }
-
Make sure the settings are correct.
-
Using the command line, navigate to the folder that contains the up-to-date Terraform configuration files with an infrastructure plan.
-
Run the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
-
Confirm updating the resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
-
-
Get an IAM token for API authentication and place it in the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Database.update method and make a request, e.g., via cURL
:Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the
updateMask
parameter (one line separated by commas).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>", "version": "<extension_version>" }, { <similar_configuration_for_extension_2> }, { ... }, { <similar_configuration_for_extension_N> } ] }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.In this case, only one parameter is provided.
-
extensions
: Array of DB extensions. Each object represents one extension and has the following structure:name
: Extension name.version
: Extension version.
Specify the name and version from the list of supported PostgreSQL extensions and utilities.
You can get the cluster ID with the list of clusters in your folder, and the DB name with the list of databases in your cluster.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and place it in the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the DatabaseService/Update call and make a request, e.g., via gRPCurl
:Warning
This API method will assign default values to all object parameters not explicitly set in the request. To avoid this, list the settings you want to change in the
update_mask
parameter 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>", "version": "<extension_version>" }, { <similar_configuration_for_extension_2> }, { ... }, { <similar_configuration_for_extension_N> } ] }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.postgresql.v1.DatabaseService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings.In this case, only one parameter is provided.
-
extensions
: Array of DB extensions. One array element contains settings for a single extension and has the following structure:name
: Extension name.version
: Extension version.
Specify the name and version from the list of supported PostgreSQL extensions and utilities.
You can get the cluster ID with the list of clusters in your folder, and the DB name with the list of databases in your cluster.
-
-
View the server response to make sure the request was successful.
Supported PostgreSQL extensions and utilities
Extension \ PostgreSQL version |
11 |
12 |
13 |
14 |
15 |
16 |
Contains functions for normalizing mailing addresses provided as a string. |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
Contains rules for normalizing US and Canadian mailing addresses for the |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
Contains functions for checking the logical consistency of the database relational structure. To use this extension, you need the |
1.1 |
1.2 |
1.2 |
1.3 |
1.3 |
1.3 |
Contains the
|
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 |
Contains example classes of the GIN (Generalized Inverted Index) operator used for inverted searches. |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
Contains GiST (Generalized Search Tree) operator classes. Unlike B-tree indexes, GiST supports such operators as |
1.5 |
1.5 |
1.5 |
1.6 |
1.7 |
1.7 |
Contains the |
1.5 |
1.6 |
1.6 |
1.6 |
1.6 |
1.6 |
Adds Foreign Data Wrapper |
1.3 |
1.3 |
1.3 |
- |
1.4 |
- |
Contains the |
1.4 |
1.4 |
1.4 |
1.5 |
1.5 |
1.5 |
Allows connecting to other PostgreSQL databases from the current session. To use this extension, you need the |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
Contains an example of an add-on dictionary template for full-text search. This template allows you to contain the growth of the unique words list and makes search faster. Aside from the extension, you can also use Hunspell dictionaries for full-text search. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
Contains an example of an add-on dictionary (Extended Synonym Dictionary) template for full-text search: when you search for a word, the results will also return all its synonyms. Aside from the extension, you can also use Hunspell dictionaries for full-text search. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
Provides a module for calculating distances between geographical points. There are two ways to calculate them:
|
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
Contains functions used to identify similarities and differences between strings. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.2 |
Contains the |
1.5 |
1.6 |
1.7 |
1.8 |
1.8 |
1.8 |
Adds support for virtual, or hypothetical, indexes. They allow you to check if PostgreSQL will use real indexes to handle problematic queries with minimal resources required.> |
1.3.1 |
1.3.1 |
1.3.1 |
1.3.1 |
1.3.1 |
1.4.0 |
Contains functions and operators for manipulating arrays of integers that do not contain any |
1.2 |
1.2 |
1.3 |
1.5 |
1.5 |
1.5 |
Provides data types for international product numbering standards such as EAN13, UPC, ISBN, ISMN, and ISSN. The numbers are checked and generated according to the specified list of prefixes. |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
Adds support for the JsQuery language to work with the |
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 |
Contains the |
1.1 |
1.1 |
1.2 |
1.2 |
1.2 |
1.2 |
Contains the |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
Adds Foreign Data Wrapper To use this extension, you need the |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
Adds functions and operators that emulate a set of Oracle DB functions and packages. |
3.18 |
3.18 |
3.18 |
3.18 |
3.25 |
4.6 |
Provides functions for monitoring a shared buffer cache. To use this extension, you need the |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.4 |
Enables you to add scheduled jobs to a database and run SQL queries directly from a job. Requires enabling the To use this extension, you need the Enabling the extension causes 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 |
Contains functions for managing the PostgreSQL planner. Requires enabling the |
1.3.4 |
1.3.5 |
1.3.7 |
1.4 |
- |
1.6.0 |
Provides extended table partitioning features, including time-based and serial-based partitioning. |
4.0.0 |
4.2.0 |
4.4.0 |
4.6.0 |
4.7.0 |
4.7.4 |
Enables collecting statistics on predicates in Requires enabling the |
2.0.3 |
2.0.3 |
2.0.3 |
2.0.3 |
2.0.4 |
2.1.0 |
Enables loading relation data into either the operating system buffer cache or the PostgreSQL buffer cache. |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
Contains functions to remove 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 |
Enables collecting statistics on the read and write operations performed at the file system level. Requires enabling 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 |
Enables you to track planning and 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 |
Enables you to create a logical replication slot in the past. |
1.0 |
1.0 |
1.0 |
1.0 |
1.1 |
1.1.1 |
Contains tools to quickly search for similar strings based on trigram matching. |
1.4 |
1.4 |
1.5 |
1.6 |
1.6 |
1.6 |
Provides additional logging tools and enhances audit capabilities. Requires enabling the For more information, see Using pgaudit. |
1.0.0 |
1.0.0 |
1.0.0 |
1.0.0 |
1.7 |
16.0 |
Provides cryptographic functions for PostgreSQL. For more information, see Using pgcrypto. |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
1.3 |
Adds support for logical streaming replication using the publish/subscribe mechanism. |
2.4.1 |
2.4.1 |
2.4.1 |
2.4.1 |
- |
2.4.3 |
Extends the PostGIS |
2.6.2 |
2.6.2 |
3.0.2 |
3.3.0 |
3.4.1 |
3.5.0 |
Contains the |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
1.2 |
Contains functions to obtain tuple-level statistics. To use this extension, you need the |
1.5 |
1.5 |
1.5 |
1.5 |
1.5 |
1.5 |
Enables vector similarity search. |
0.2.5 |
0.2.5 |
0.2.5 |
0.2.5 |
0.3.2 |
- |
Adds support for the procedural language based on JavaScript and the V8 engine. |
3.0.0 |
3.0.0 |
3.0.0 |
3.0.0 |
- |
3.2.0 |
Allows you to store and process GIS (Geographic Information Systems) objects in PostgreSQL databases. |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
Contains functions for geocoding based on TIGER |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
Contains |
2.5.2 |
3.0.0 |
3.1.4 |
3.1.4 |
3.3.2 |
3.4.0 |
Adds Foreign Data Wrapper To use this extension, you need the |
1.0 |
1.0 |
1.0 |
1.1 |
1.1 |
1.1 |
Provides an access method to work with |
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 |
Contains functions for determining array similarity. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
Contains functions that return tables, i.e., multiple rows. |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
1.0 |
Supports automatic partitioning across time and space (partitioning key), yet retains the standard PostgreSQL interface for data. This makes PostgreSQL scalable for time-series data. Requires enabling the The TimescaleDB edition installed for the service is TimescaleDB Apache 2 Edition. It has limited functionality compared to TimescaleDB Community Edition. You cannot change the edition. For more information about its limitations, see the TimescaleDB documentation |
2.3.1 |
2.4.2 |
2.5.2 |
2.6.1 |
2.9.0 |
2.13.0-dev |
Contains a text search dictionary that removes diacritic signs. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
Contains functions to generate UUIDs using standard algorithms. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
Adds XPath querying and XSLT functionality. |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
1.1 |
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>
Requires enabling the pgstattuple
extension.
To use it, you need the mdb_admin
role.
ClickHouse® is a registered trademark of ClickHouse, Inc