Installing and Uninstalling a Plugin Using SQL Commands

RDS provides the PostgreSQL plugin management solution for user root. Except the following plugins, you need to manually create other plugins by referring to this section.

  • RDS for PostgreSQL plugins only take effect on the databases you created the plugins for. To use a plugin on databases, it has to be created separately for each database.
  • The latest minor versions of RDS for PostgreSQL 11, 12, 13, and 14 allow the root user to create plugins (create extension) or delete plugins (drop extension).

Creating a Plugin

Connect to the database where a plugin needs to be created as user root and run the following SQL statements:

select control_extension('create','<EXTENSION_NAME>', '<SCHEMA>');

Example:

Create postgis in the public schema.
-- Specify the public schema for creating the plugin.
select control_extension('create','postgis', 'public');
       control_extension       
 ------------------------------
  create postgis successfully.
 (1 row)
-- If the schema parameter is not specified, the default schema is public.
select control_extension('create', 'postgis');
      control_extension       
------------------------------
 create postgis successfully.
(1 row)

Deleting a Plugin

Connect to the database where a plugin needs to be created as user root and run the following SQL statements:

select control_extension('drop','<EXTENSION_NAME>', '<SCHEMA>');

Example:

select control_extension('drop','postgis');
      control_extension      
 ----------------------------
  drop postgis successfully.
 (1 row)

Common Errors