Rediger

Del via


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

  1. Allowlist the extension.

  2. The user that drops the extensions must be a member of the azure_pg_admin role.

  3. 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>;
  1. Some extensions might distribute objects required by other extension. It's the case, for example, of the vector extension, in which the pg_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 run DROP 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 the CASCADE clause, so that it automatically drops all extensions on which it depends.
    DROP EXTENSION <depending_extension> CASCADE;