1DROP OWNED(7) PostgreSQL 9.2.24 Documentation DROP OWNED(7)
2
3
4
6 DROP_OWNED - remove database objects owned by a database role
7
9 DROP OWNED BY name [, ...] [ CASCADE | RESTRICT ]
10
12 DROP OWNED drops all the objects within the current database that are
13 owned by one of the specified roles. Any privileges granted to the
14 given roles on objects in the current database and on shared objects
15 (databases, tablespaces) will also be revoked.
16
18 name
19 The name of a role whose objects will be dropped, and whose
20 privileges will be revoked.
21
22 CASCADE
23 Automatically drop objects that depend on the affected objects.
24
25 RESTRICT
26 Refuse to drop the objects owned by a role if any other database
27 objects depend on one of the affected objects. This is the default.
28
30 DROP OWNED is often used to prepare for the removal of one or more
31 roles. Because DROP OWNED only affects the objects in the current
32 database, it is usually necessary to execute this command in each
33 database that contains objects owned by a role that is to be removed.
34
35 Using the CASCADE option might make the command recurse to objects
36 owned by other users.
37
38 The REASSIGN OWNED (REASSIGN_OWNED(7)) command is an alternative that
39 reassigns the ownership of all the database objects owned by one or
40 more roles. However, REASSIGN OWNED does not deal with privileges for
41 other objects.
42
43 Databases and tablespaces owned by the role(s) will not be removed.
44
45 See Section 20.4, “Dropping Roles”, in the documentation for more
46 discussion.
47
49 The DROP OWNED command is a PostgreSQL extension.
50
52 REASSIGN OWNED (REASSIGN_OWNED(7)), DROP ROLE (DROP_ROLE(7))
53
54
55
56PostgreSQL 9.2.24 2017-11-06 DROP OWNED(7)