RefLib

Reference library for AI

Back

postgresql_16:7.1.120.3 Notes

PostgreSQL 16 > Reference > SQL Commands > DROP OWNED > Notes

DROP OWNED is often used to prepare for the removal of one or more roles. Because DROP OWNED only affects the objects in the current database, it is usually necessary to execute this command in each database that contains objects owned by a role that is to be removed.

Using the CASCADE option might make the command recurse to objects owned by other users.

The REASSIGN OWNED (see postgresql_16:7.1.159) command is an alternative that reassigns the ownership of all the database objects owned by one or more roles. However, REASSIGN OWNED does not deal with privileges for other objects.

Databases and tablespaces owned by the role(s) will not be removed.

See (see postgresql_16:4.7.4) for more discussion.

Back