1REASSIGN OWNED(7)        PostgreSQL 10.7 Documentation       REASSIGN OWNED(7)
2
3
4

NAME

6       REASSIGN_OWNED - change the ownership of database objects owned by a
7       database role
8

SYNOPSIS

10       REASSIGN OWNED BY { old_role | CURRENT_USER | SESSION_USER } [, ...]
11                      TO { new_role | CURRENT_USER | SESSION_USER }
12

DESCRIPTION

14       REASSIGN OWNED instructs the system to change the ownership of database
15       objects owned by any of the old_roles to new_role.
16

PARAMETERS

18       old_role
19           The name of a role. The ownership of all the objects within the
20           current database, and of all shared objects (databases,
21           tablespaces), owned by this role will be reassigned to new_role.
22
23       new_role
24           The name of the role that will be made the new owner of the
25           affected objects.
26

NOTES

28       REASSIGN OWNED is often used to prepare for the removal of one or more
29       roles. Because REASSIGN OWNED does not affect objects within other
30       databases, it is usually necessary to execute this command in each
31       database that contains objects owned by a role that is to be removed.
32
33       REASSIGN OWNED requires privileges on both the source role(s) and the
34       target role.
35
36       The DROP OWNED (DROP_OWNED(7)) command is an alternative that simply
37       drops all the database objects owned by one or more roles.
38
39       The REASSIGN OWNED command does not affect any privileges granted to
40       the old_roles for objects that are not owned by them. Use DROP OWNED to
41       revoke such privileges.
42
43       See Section 21.4 for more discussion.
44

COMPATIBILITY

46       The REASSIGN OWNED command is a PostgreSQL extension.
47

SEE ALSO

49       DROP OWNED (DROP_OWNED(7)), DROP ROLE (DROP_ROLE(7)), ALTER DATABASE
50       (ALTER_DATABASE(7))
51
52
53
54PostgreSQL 10.7                      2019                    REASSIGN OWNED(7)
Impressum