Drop extensions
APPLIES TO: Azure Database for PostgreSQL - Flexible Server
Before dropping extensions in Azure Database for PostgreSQL flexible server, you must allowlist them.
Steps to drop extensions
Allowlist the extension.
The user that drops the extensions must be a member of the
azure_pg_admin
role.Run the DROP EXTENSION command to drop or uninstall a particular extension. This command drops the objects packaged in the extension from your database.
DROP EXTENSION <extension>;
Some extensions might distribute objects required by other extension. It's the case, for example, of the
vector
extension, in which thepg_diskann
extension depends. To drop such extensions, you can proceed in two ways:- Allowlist and run
DROP EXTENSION
on all the extensions that depend on the one that you're trying to drop first. Then, allowlist and runDROP EXTENSION
on the extension on which other extensions depended.
DROP EXTENSION <dependent_extension>; DROP EXTENSION <depending_extension>;
- Allowlist and run
DROP EXTENSION
on the extension that you want to drop, that other extensions depend on, but add theCASCADE
clause, so that it automatically drops all extensions on which it depends.
DROP EXTENSION <depending_extension> CASCADE;
- Allowlist and run