DROP OWNED

Synopsis

Use the DROP OWNED statement to drop all database objects within the current database that are owned by one of the specified roles.Any privileges granted to the given roles on objects in the current database or on shared objects will also be revoked.

Syntax

  1. drop_owned ::= DROP OWNED BY role_specification [ , ... ]
  2. [ CASCADE | RESTRICT ]
  3. role_specification ::= role_name | CURRENT_USER | SESSION_USER

drop_owned

DROP OWNED - 图1

role_specification

DROP OWNED - 图2

Semantics

  • CASCADE

Automatically drop objects that depend on the affected objects.

  • RESTRICT

This is the default mode and will raise an error if there are other database objects that depend on the dropped objects.

Examples

  • Drop all objects owned by john.
  1. yugabyte=# drop owned by john;

See also