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

in a desired database by a user with CREATE permissions.

 

Enable an Extension

Some extensions can’t be instantiated by the user and need special enablement. This can be done at cluster provisioning time or via the API or console at a later time. Note that enablement after the cluster is created may require support to perform a manual restart on your cluster to complete the setup.

 

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

 

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

 

Instantiate an Extension

To instantiate an extension in a database, open the psql terminal, connect to your desired database and run: 

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. 

PG Cron

PG Cron allow for running SQL on a schedule. It uses the same syntax as the cron unix command. It allows these jobs to run SQL in a specified database as the user which create the Cron job. 

As part of the enablement for PG Cron the extension will created in the ‘postgres’ database and the icpostgresql user appropriate access.

You can check this by running the following command in a psql terminal in the ‘postgres database.

Scheduling jobs in other databases can be performed with the cron.schedule_in_database function.

Note: ‘*/10 * * * *’ above refers to the interval in which the statement will run. This example is for every 10 minutes. Users should be aware that the frequency and number of Cron jobs will will have impact on cluster performance. These jobs will be run in worker threads, and we configure limits based on node size.

 

 

 

 

By Instaclustr Support
Need Support?
Experiencing difficulties on the website or console?
Already have an account?
Need help with your cluster?
Contact Support
Why sign up?
To experience the ease of creating and managing clusters via the Instaclustr Console
Spin up a cluster in minutes