Updated on 2025-03-13 GMT+08:00

DROP PACKAGE

Description

Drops an existing package or package body.

Precautions

After the package body is deleted, the stored procedures and functions in the package become invalid at the same time.

Syntax

DROP PACKAGE [ IF EXISTS ] package_name;
DROP PACKAGE BODY [ IF EXISTS ] package_name;

Parameters

  • IF EXISTS

    Reports a notice instead of an error if the specified stored procedure does not exist.

  • package_name

    Specifies the name of the package to be dropped.

    Value range: an existing package name.

Examples

-- Create a package.
gaussdb=# CREATE OR REPLACE PACKAGE PCK1
IS
a int;
END pck1;
/
CREATE PACKAGE

-- Drop the package.
gaussdb=# DROP PACKAGE PCK1;
DROP PACKAGE

Helpful Links

ALTER PACKAGE and CREATE PACKAGE