1DROP OWNED(7)                    SQL Commands                    DROP OWNED(7)
2
3
4

NAME

6       DROP OWNED - remove database objects owned by a database role
7
8

SYNOPSIS

10       DROP OWNED BY name [, ...] [ CASCADE | RESTRICT ]
11
12

DESCRIPTION

14       DROP  OWNED  drops all the objects within the current database that are
15       owned by one of the specified roles.  Any  privileges  granted  to  the
16       given  roles  on  objects in the current database and on shared objects
17       (databases, tablespaces) will also be revoked.
18

PARAMETERS

20       name   The name of a role whose objects  will  be  dropped,  and  whose
21              privileges will be revoked.
22
23       CASCADE
24              Automatically drop objects that depend on the affected objects.
25
26       RESTRICT
27              Refuse to drop the objects owned by a role if any other database
28              objects depend on one of  the  affected  objects.  This  is  the
29              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 data‐
34       base,  it is usually necessary to execute this command in each database
35       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.
43
44       Databases and tablespaces owned by the role(s) will not be removed.
45

COMPATIBILITY

47       The DROP OWNED statement is a PostgreSQL extension.
48

SEE ALSO

50       REASSIGN OWNED [reassign_owned(7)], DROP ROLE [drop_role(7)]
51
52
53
54SQL - Language Statements         2014-02-17                     DROP OWNED(7)
Impressum