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.
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:
-- 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)
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)
ERROR: permission denied for function control_extension
Solution: Use root to run the control_extension function.
ERROR: function control_extension(unknown, unknown) is not unique
Solution: Add the schema parameter in the function. If the schema is not specified, there may be functions with the same name, causing execution failures.
ERROR: function control_extension(unknown, unknown) does not exist
Solution: Do not create plugins in the postgres database. The control_extension function does not exist in the postgres database because this database is used as an O&M database.