Updated on 2024-05-07 GMT+08:00

DROP OWNED

Description

Deletes the database objects owned by a database role.

Precautions

  • This interface will revoke the role's permissions on all objects in the current database and shared objects (databases and tablespaces).
  • DROP OWNED is often used to prepare for removing one or more roles. Because DROP OWNED affects only the objects in the current database, you need to run this statement in each database that contains the objects owned by the role to be removed.
  • Using the CASCADE option may cause this statement to recursively remove objects owned by other users.
  • The databases and tablespaces owned by the role will not be removed.
  • Private database links owned by a role can be deleted only after the CASCADE option is added.

Syntax

DROP OWNED BY name [, ...] [ CASCADE | RESTRICT ];

Parameters

  • name

    Specifies the role name.

  • CASCADE | RESTRICT
    • CASCADE: automatically deletes the objects that depend on the objects to be deleted.
    • RESTRICT: refuses to delete the objects if other objects depend on them. This is the default action.

Helpful Links

REASSIGN OWNED and DROP ROLE