DROP PACKAGE
DROP PACKAGE — remove a package
Synopsis
DROP PACKAGE [ IF EXISTS ] package_name [, ...] [ CASCADE ]
Description
DROP PACKAGE removes packages from the database.
A package can only be dropped by its owner or a superuser. Note that the owner can drop the package (and thereby all contained objects) even if they do not own some of the objects within the package.
Parameters
IF EXISTSDo not throw an error if the package does not exist. A notice is issued in this case.
package_nameThe name of a package.
CASCADEAutomatically drop objects (tables, functions, etc.) that are contained in the package, and in turn all objects that depend on those objects (see Section 5.15).
Notes
Using the CASCADE option might make the command find objects to be removed in other packages besides the one(s) named. In this case, other packages are dropped as well.
Examples
To remove package counter from the database, along with everything it contains and all the dependent objects:
DROP PACKAGE counter CASCADE;