1DROP OWNED(7)            PostgreSQL 11.6 Documentation           DROP OWNED(7)
2
3
4

NAME

6       DROP_OWNED - remove database objects owned by a database role
7

SYNOPSIS

9       DROP OWNED BY { name | CURRENT_USER | SESSION_USER } [, ...] [ CASCADE | RESTRICT ]
10

DESCRIPTION

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 or on shared objects
15       (databases, tablespaces) will also be revoked.
16

PARAMETERS

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, and
24           in turn all objects that depend on those objects (see
25           Section 5.13).
26
27       RESTRICT
28           Refuse to drop the objects owned by a role if any other database
29           objects depend on one of the affected objects. This is the default.
30

NOTES

32       DROP OWNED is often used to prepare for the removal of one or more
33       roles. Because DROP OWNED only affects the objects in the current
34       database, it is usually necessary to execute this command in each
35       database that contains objects owned by a role that is to be removed.
36
37       Using the CASCADE option might make the command recurse to objects
38       owned by other users.
39
40       The REASSIGN OWNED (REASSIGN_OWNED(7)) command is an alternative that
41       reassigns the ownership of all the database objects owned by one or
42       more roles. However, REASSIGN OWNED does not deal with privileges for
43       other objects.
44
45       Databases and tablespaces owned by the role(s) will not be removed.
46
47       See Section 21.4 for more discussion.
48

COMPATIBILITY

50       The DROP OWNED command is a PostgreSQL extension.
51

SEE ALSO

53       REASSIGN OWNED (REASSIGN_OWNED(7)), DROP ROLE (DROP_ROLE(7))
54
55
56
57PostgreSQL 11.6                      2019                        DROP OWNED(7)
Impressum