Extensions that require additional Instantiation steps
There is a group of extensions requires additional setup on a per database basis. This usually require SQL to run as the superuser to create or drop the extension. This is usually the CREATE EXTENSION or DROP EXTENSION commands but may also be additional statements depending on the extension. To preserve aspects of security and superuser integrity we have added a mechanism via the API and console to perform these operations on your cluster.
You can verify the list of active extension on your database with the following command in psql terminal
1 |
\dx |
Example output:
1 2 3 4 5 6 7 8 9 |
postgres=> \dx List of installed extensions Name | Version | Schema | Description --------------------+---------+------------+------------------------------------------------------------------------ pg_cron | 1.6 | pg_catalog | Job scheduler for PostgreSQL pg_stat_statements | 1.10 | public | track planning and execution statistics of all SQL statements executed plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language vector | 0.7.1 | public | vector data type and ivfflat and hnsw access methods (4 rows) |
Create Extension
The create extension operation instantiates the specified extension for the provided list of databases.
Via API
PostgreSQL extension can be instantiated for a database with the create extension API
Example
1 2 3 4 5 6 7 8 9 |
curl -i -X POST \ -u <username>:<password> \ 'https://api.instaclustr.com/cluster-management/v2/operations/applications/postgresql/clusters/{clusterId}/extensions/create/PG_VECTOR/v1' \ -H 'Content-Type: application/json' \ -d '{ "dataBaseNames": [ "my_corp_db" ] }' |
Via Console
Step 1.
First navigate to the PostgreSQL Extension Page. Then select the create tab.
Step 2.
Select the Extension and type in the name of the database you wish to create the extension in. You may use a comma separated list to specify more than one database. Press the Create Extension button.
Drop Extension
Via API
PostgreSQL extension can be dropped from a database with the drop extension API
Example
1 2 3 4 5 6 7 8 9 |
curl -i -X POST \ -u <username>:<password> \ 'https://api.instaclustr.com/cluster-management/v2/operations/applications/postgresql/clusters/{clusterId}/extensions/drop/PG_VECTOR/v1' \ -H 'Content-Type: application/json' \ -d '{ "dataBaseNames": [ "my_corp_db" ] }' |
Via Console
Step 1.
First navigate to the PostgreSQL Extension Page. Then select the drop tab.
Step 2.
Select the Extension and type in the name of the database you wish to drop the extension in. You may use a comma separate list to specify more than one database. Press the Drop Extension button.
Select the Extension and type in the name of the database you wish to drop the extension in. You may use a comma separate list to specify more than one database. Press the Drop Extension button.