2 .\" Title: ALTER SCHEMA
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 "ALTER SCHEMA" "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 ALTER_SCHEMA \- change the definition of a schema
35 ALTER SCHEMA \fIname\fR RENAME TO \fInew_name\fR
36 ALTER SCHEMA \fIname\fR OWNER TO { \fInew_owner\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
41 changes the definition of a schema\&.
43 You must own the schema to use
44 \fBALTER SCHEMA\fR\&. To rename a schema you must also have the
46 privilege for the database\&. To alter the owner, you must be able to
48 to the new owning role, and that role must have the
50 privilege for the database\&. (Note that superusers have all these privileges automatically\&.)
55 The name of an existing schema\&.
60 The new name of the schema\&. The new name cannot begin with
61 pg_, as such names are reserved for system schemas\&.
66 The new owner of the schema\&.
72 statement in the SQL standard\&.
74 CREATE SCHEMA (\fBCREATE_SCHEMA\fR(7)), DROP SCHEMA (\fBDROP_SCHEMA\fR(7))