PostgreSQL – DROP OWNED

DROP OWNED is used to drop all database objects owned by a user or a role. Below is the syntax of using the DROP OWNED BY command:

DROP OWNED BY  username | rolename;

Where username or rolename is the name of the user or role that owns the objects.

DROP OWNED BY command drops the objects only from the current database. If you need to drop objects from other databases, you need to connect to each database and run the command.

Similar Posts