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

DROP RULE

Function

DROP RULE deletes a rewriting rule.

Syntax

DROP RULE [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]

Parameter Description

  • IF EXISTS

    If the rule does not exist, a NOTICE is thrown.

  • name

    Name of an existing rule to be deleted.

  • table_name

    Name of the table to which the rule applies.

  • CASCADE

    Automatically cascade deletes objects that depend on this rule.

  • RESTRICT

    By default, if any objects depend on the rule, the rule cannot be deleted.

Examples

-- Delete a rewriting rule (newrule).
DROP RULE newrule ON mytable;