]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_SCHEMA.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_SCHEMA.7
1 '\" t
2 .\"     Title: ALTER SCHEMA
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ALTER_SCHEMA \- change the definition of a schema
32 .SH "SYNOPSIS"
33 .sp
34 .nf
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 }
37 .fi
38 .SH "DESCRIPTION"
39 .PP
40 \fBALTER SCHEMA\fR
41 changes the definition of a schema\&.
42 .PP
43 You must own the schema to use
44 \fBALTER SCHEMA\fR\&. To rename a schema you must also have the
45 CREATE
46 privilege for the database\&. To alter the owner, you must be able to
47 SET ROLE
48 to the new owning role, and that role must have the
49 CREATE
50 privilege for the database\&. (Note that superusers have all these privileges automatically\&.)
51 .SH "PARAMETERS"
52 .PP
53 \fIname\fR
54 .RS 4
55 The name of an existing schema\&.
56 .RE
57 .PP
58 \fInew_name\fR
59 .RS 4
60 The new name of the schema\&. The new name cannot begin with
61 pg_, as such names are reserved for system schemas\&.
62 .RE
63 .PP
64 \fInew_owner\fR
65 .RS 4
66 The new owner of the schema\&.
67 .RE
68 .SH "COMPATIBILITY"
69 .PP
70 There is no
71 \fBALTER SCHEMA\fR
72 statement in the SQL standard\&.
73 .SH "SEE ALSO"
74 CREATE SCHEMA (\fBCREATE_SCHEMA\fR(7)), DROP SCHEMA (\fBDROP_SCHEMA\fR(7))