Postgresql 中文操作指南
Description
DROP EXTENSION 从数据库中删除扩展。删除一个扩展会导致其成员对象和其它明确依赖例程(参见 ALTER ROUTINE , DEPENDS ON EXTENSION _extension_name_ 操作)也一并被删除。
DROP EXTENSION removes extensions from the database. Dropping an extension causes its member objects, and other explicitly dependent routines (see ALTER ROUTINE, the DEPENDS ON EXTENSION _extension_name_ action), to be dropped as well.
使用 DROP EXTENSION 时,必须拥有该扩展。
You must own the extension to use DROP EXTENSION.
Parameters
-
IF EXISTS
-
Do not throw an error if the extension does not exist. A notice is issued in this case.
-
-
name
-
The name of an installed extension.
-
-
CASCADE
-
Automatically drop objects that depend on the extension, and in turn all objects that depend on those objects (see Section 5.14).
-
-
RESTRICT
-
This option prevents the specified extensions from being dropped if other objects, besides these extensions, their members, and their explicitly dependent routines, depend on them. This is the default.
-
Examples
要从当前数据库中删除扩展 hstore :
To remove the extension hstore from the current database:
DROP EXTENSION hstore;
如果任何 hstore 的对象在数据库中正在使用,此命令将失败,例如如果任何表具有 hstore 类型的列。添加 CASCADE 选项以强制删除那些依赖对象。
This command will fail if any of hstore's objects are in use in the database, for example if any tables have columns of the hstore type. Add the CASCADE option to forcibly remove those dependent objects as well.