1ALTER TABLESPACE(7) PostgreSQL 16.1 Documentation ALTER TABLESPACE(7)
2
3
4
6 ALTER_TABLESPACE - change the definition of a tablespace
7
9 ALTER TABLESPACE name RENAME TO new_name
10 ALTER TABLESPACE name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
11 ALTER TABLESPACE name SET ( tablespace_option = value [, ... ] )
12 ALTER TABLESPACE name RESET ( tablespace_option [, ... ] )
13
15 ALTER TABLESPACE can be used to change the definition of a tablespace.
16
17 You must own the tablespace to change the definition of a tablespace.
18 To alter the owner, you must also be able to SET ROLE to the new owning
19 role. (Note that superusers have these privileges automatically.)
20
22 name
23 The name of an existing tablespace.
24
25 new_name
26 The new name of the tablespace. The new name cannot begin with pg_,
27 as such names are reserved for system tablespaces.
28
29 new_owner
30 The new owner of the tablespace.
31
32 tablespace_option
33 A tablespace parameter to be set or reset. Currently, the only
34 available parameters are seq_page_cost, random_page_cost,
35 effective_io_concurrency and maintenance_io_concurrency. Setting
36 these values for a particular tablespace will override the
37 planner's usual estimate of the cost of reading pages from tables
38 in that tablespace, and the executor's prefetching behavior, as
39 established by the configuration parameters of the same name (see
40 seq_page_cost, random_page_cost, effective_io_concurrency,
41 maintenance_io_concurrency). This may be useful if one tablespace
42 is located on a disk which is faster or slower than the remainder
43 of the I/O subsystem.
44
46 Rename tablespace index_space to fast_raid:
47
48 ALTER TABLESPACE index_space RENAME TO fast_raid;
49
50 Change the owner of tablespace index_space:
51
52 ALTER TABLESPACE index_space OWNER TO mary;
53
55 There is no ALTER TABLESPACE statement in the SQL standard.
56
58 CREATE TABLESPACE (CREATE_TABLESPACE(7)), DROP TABLESPACE
59 (DROP_TABLESPACE(7))
60
61
62
63PostgreSQL 16.1 2023 ALTER TABLESPACE(7)