DROP RULE

Synopsis

Use the DROP RULE statement to remove a rule.

Syntax

  1. drop_rule ::= DROP RULE [ IF EXISTS ] rule_name ON table_name
  2. [ CASCADE | RESTRICT ]

drop_rule

DROP RULE - 图1

Semantics

See the semantics of each option in the [PostgreSQL docs][postgresql-docs-drop-rule].

Examples

Basic example.

  1. yugabyte=# CREATE TABLE t1(a int4, b int4);
  2. yugabyte=# CREATE TABLE t2(a int4, b int4);
  3. yugabyte=# CREATE RULE t1_to_t2 AS ON INSERT TO t1 DO INSTEAD
  4. INSERT INTO t2 VALUES (new.a, new.b);
  5. yugabyte=# DROP RULE t1_to_t2 ON t1;

See also