Updated on 2025-10-23 GMT+08:00

DROP AUDIT POLICY

Description

Deletes an audit policy. Currently, the distributed mode is not supported.

Precautions

Only users with the POLADMIN or SYSADMIN permission, or the initial user can perform this operation.

Syntax

1
DROP AUDIT POLICY [IF EXISTS] policy_name;

Parameters

  • policy_name

    Specifies the audit policy name, which must be unique.

    Value range: a string. It must comply with the naming conventions.

  • IF EXISTS

    Checks whether the audit policy exists. If it exists, the deletion is successful. Otherwise, a NOTICE message is sent.

Examples

-- Create the adt1 policy.
m_db=# CREATE AUDIT POLICY adt1 PRIVILEGES CREATE; 
CREATE AUDIT POLICY

-- Delete the audit policy adt1.
m_db=# DROP AUDIT POLICY adt1;
DROP AUDIT POLICY

-- When you delete the audit policy adt0 that does not exist, the system displays a message indicating that the deletion fails because the audit policy does not exist.
m_db=# DROP AUDIT POLICY adt0;
ERROR:  adt0 policy does not exist, drop failed