Skip to main content

DROP OWNED

Removes all database objects owned by a role.


Syntax

DROP OWNED BY { <name> | CURRENT_USER | SESSION_USER } [, ...] [CASCADE | RESTRICT]

Description

DROP OWNED drops all objects in the current database that are owned by one of the specified roles. The privileges granted to the roles on the objects in the current database or the shared objects will also be revoked.


Parameters

  • <name>

    The name of the role. You can specify multiple role names.

  • CASCADE or RESTRICT

    Whether to drop the objects owned by the role and the objects that depend on the affected objects, if any. Supported options include:

    • CASCADE: specifies to drop them.
    • RESTRICT: specifies to reject the drop operation and is the default.

Examples

Drop database objects owned by role mary:

DROP OWNED BY mary;

SQL standard compatibility

DROP OWNED is a Relyt extension.