Enable or disable a PostgreSQL extension
To use a PostgreSQL extension its necessary to first enable the extension in the PostgreSQL cluster and then instantiate the extension in a desired database.
Enabling an extension is when a user adds the extension’s required permissions and configuration parameters to the PostgreSQL configuration.
Instantiating an extension means to run the PostgreSQL command
1 | CREATE EXTENSION <extension name>; |
in a desired database by a user with CREATE permissions.
Enable an Extension
Via Console
1. To enable an extension, first, navigate to the PostgreSQL Extensions page of your PostgreSQL cluster. From the PostgreSQL Extensions page, click the Enable button. You will be redirected to the form to enable available extensions.
2. Select the extension that you want to enable by pressing on the corresponding checkbox and then press on the Enable button.
Via API
PostgreSQL extensions can also be enabled via Update PostgreSQL cluster details endpoint from provisioning API. You can find the how to access and use Instaclustr’s provisioning API here.
Example request
1 2 3 4 5 6 | { "extensions": ["PG_VECTOR"], "dataCentres": [ ... ] } |
Disable an Extension
Via Console
1. To disable an extension, first, navigate to the PostgreSQL Extensions page of your PostgreSQL cluster. From the PostgreSQL Extensions page, click the Disable button on the extension that you want to disable. You will be redirected to the form to disable that particular extension.
2. Review that this is the extension that you want to disable and the press the button Disable Extension.
Via API
PostgreSQL extensions can also be disabled via Update PostgreSQL cluster details endpoint from provisioning API. You can find the how to access and use Instaclustr’s provisioning API here .
Example request
1 2 3 4 5 6 | { "extensions": [], "dataCentres": [ ... ] } |
Instantiate an Extension
To instantiate an extension in a database, open the psql terminal, connect to your desired database and run:
1 | CREATE EXTENSION <extension name>; |
Note that you will need to be authenticated as a user with CREATE permissions, on the database that you instantiate the extension into. For further details, see the official documentation.