DROP EXTENSION statement to remove an extension from the database.
drop_extension ::= DROP EXTENSION [ IF EXISTS ] extension_name [ , ... ] [ CASCADE | RESTRICT ]
- An error will be thrown if the extension does not exist unless
IF EXISTSis used. Then, a notice is issued instead.
RESTRICTis the default, and it will not drop the extension if any objects depend on it.
CASCADEwill drop any objects that transitively depend on the extension.
DROP EXTENSION IF EXISTS cube;
NOTICE: extension "cube" does not exist, skipping
CREATE EXTENSION cube; CREATE EXTENSION earthdistance; DROP EXTENSION IF EXISTS cube RESTRICT;
ERROR: cannot drop extension cube because other objects depend on it DETAIL: extension earthdistance depends on function cube_out(cube) HINT: Use DROP ... CASCADE to drop the dependent objects too.<Paste>
DROP EXTENSION IF EXISTS cube CASCADE;
NOTICE: drop cascades to extension earthdistance DROP EXTENSION