2 .\" Title: REASSIGN OWNED
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "REASSIGN OWNED" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 REASSIGN_OWNED \- change the ownership of database objects owned by a database role
35 REASSIGN OWNED BY { \fIold_role\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, \&.\&.\&.]
36 TO { \fInew_role\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
41 instructs the system to change the ownership of database objects owned by any of the
49 The name of a role\&. The ownership of all the objects within the current database, and of all shared objects (databases, tablespaces), owned by this role will be reassigned to
55 The name of the role that will be made the new owner of the affected objects\&.
60 is often used to prepare for the removal of one or more roles\&. Because
62 does not affect objects within other databases, it is usually necessary to execute this command in each database that contains objects owned by a role that is to be removed\&.
65 requires membership on both the source role(s) and the target role\&.
69 command is an alternative that simply drops all the database objects owned by one or more roles\&.
73 command does not affect any privileges granted to the
75 on objects that are not owned by them\&. Likewise, it does not affect default privileges created with
76 \fBALTER DEFAULT PRIVILEGES\fR\&. Use
78 to revoke such privileges\&.
82 for more discussion\&.
91 DROP OWNED (\fBDROP_OWNED\fR(7)), DROP ROLE (\fBDROP_ROLE\fR(7)), ALTER DATABASE (\fBALTER_DATABASE\fR(7))