]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_TABLESPACE.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_TABLESPACE.7
1 '\" t
2 .\"     Title: ALTER TABLESPACE
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 TABLESPACE" "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_TABLESPACE \- change the definition of a tablespace
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ALTER TABLESPACE \fIname\fR RENAME TO \fInew_name\fR
36 ALTER TABLESPACE \fIname\fR OWNER TO { \fInew_owner\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
37 ALTER TABLESPACE \fIname\fR SET ( \fItablespace_option\fR = \fIvalue\fR [, \&.\&.\&. ] )
38 ALTER TABLESPACE \fIname\fR RESET ( \fItablespace_option\fR [, \&.\&.\&. ] )
39 .fi
40 .SH "DESCRIPTION"
41 .PP
42 \fBALTER TABLESPACE\fR
43 can be used to change the definition of a tablespace\&.
44 .PP
45 You must own the tablespace to change the definition of a tablespace\&. To alter the owner, you must also be able to
46 SET ROLE
47 to the new owning role\&. (Note that superusers have these privileges automatically\&.)
48 .SH "PARAMETERS"
49 .PP
50 \fIname\fR
51 .RS 4
52 The name of an existing tablespace\&.
53 .RE
54 .PP
55 \fInew_name\fR
56 .RS 4
57 The new name of the tablespace\&. The new name cannot begin with
58 pg_, as such names are reserved for system tablespaces\&.
59 .RE
60 .PP
61 \fInew_owner\fR
62 .RS 4
63 The new owner of the tablespace\&.
64 .RE
65 .PP
66 \fItablespace_option\fR
67 .RS 4
68 A tablespace parameter to be set or reset\&. Currently, the only available parameters are
69 \fIseq_page_cost\fR,
70 \fIrandom_page_cost\fR,
71 \fIeffective_io_concurrency\fR
72 and
73 \fImaintenance_io_concurrency\fR\&. Setting these values for a particular tablespace will override the planner\*(Aqs usual estimate of the cost of reading pages from tables in that tablespace, and how many concurrent I/Os are issued, as established by the configuration parameters of the same name (see
74 seq_page_cost,
75 random_page_cost,
76 effective_io_concurrency,
77 maintenance_io_concurrency)\&. This may be useful if one tablespace is located on a disk which is faster or slower than the remainder of the I/O subsystem\&.
78 .RE
79 .SH "EXAMPLES"
80 .PP
81 Rename tablespace
82 index_space
83 to
84 fast_raid:
85 .sp
86 .if n \{\
87 .RS 4
88 .\}
89 .nf
90 ALTER TABLESPACE index_space RENAME TO fast_raid;
91 .fi
92 .if n \{\
93 .RE
94 .\}
95 .PP
96 Change the owner of tablespace
97 index_space:
98 .sp
99 .if n \{\
100 .RS 4
101 .\}
102 .nf
103 ALTER TABLESPACE index_space OWNER TO mary;
104 .fi
105 .if n \{\
106 .RE
107 .\}
108 .SH "COMPATIBILITY"
109 .PP
110 There is no
111 \fBALTER TABLESPACE\fR
112 statement in the SQL standard\&.
113 .SH "SEE ALSO"
114 CREATE TABLESPACE (\fBCREATE_TABLESPACE\fR(7)), DROP TABLESPACE (\fBDROP_TABLESPACE\fR(7))