]> begriffs open source - ai-pg/blob - full-docs/txt/sql-drop-owned.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-drop-owned.txt
1
2 DROP OWNED
3
4    DROP OWNED — remove database objects owned by a database role
5
6 Synopsis
7
8 DROP OWNED BY { name | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, ...] [ CA
9 SCADE | RESTRICT ]
10
11 Description
12
13    DROP OWNED drops all the objects within the current database that are
14    owned by one of the specified roles. Any privileges granted to the
15    given roles on objects in the current database or on shared objects
16    (databases, tablespaces, configuration parameters) will also be
17    revoked.
18
19 Parameters
20
21    name
22           The name of a role whose objects will be dropped, and whose
23           privileges will be revoked.
24
25    CASCADE
26           Automatically drop objects that depend on the affected objects,
27           and in turn all objects that depend on those objects (see
28           Section 5.15).
29
30    RESTRICT
31           Refuse to drop the objects owned by a role if any other database
32           objects depend on one of the affected objects. This is the
33           default.
34
35 Notes
36
37    DROP OWNED is often used to prepare for the removal of one or more
38    roles. Because DROP OWNED only affects the objects in the current
39    database, it is usually necessary to execute this command in each
40    database that contains objects owned by a role that is to be removed.
41
42    Using the CASCADE option might make the command recurse to objects
43    owned by other users.
44
45    The REASSIGN OWNED command is an alternative that reassigns the
46    ownership of all the database objects owned by one or more roles.
47    However, REASSIGN OWNED does not deal with privileges for other
48    objects.
49
50    Databases and tablespaces owned by the role(s) will not be removed.
51
52    See Section 21.4 for more discussion.
53
54 Compatibility
55
56    The DROP OWNED command is a PostgreSQL extension.
57
58 See Also
59
60    REASSIGN OWNED, DROP ROLE