1ALTER TABLESPACE(7)      PostgreSQL 13.4 Documentation     ALTER TABLESPACE(7)
2
3
4

NAME

6       ALTER_TABLESPACE - change the definition of a tablespace
7

SYNOPSIS

9       ALTER TABLESPACE name RENAME TO new_name
10       ALTER TABLESPACE name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
11       ALTER TABLESPACE name SET ( tablespace_option = value [, ... ] )
12       ALTER TABLESPACE name RESET ( tablespace_option [, ... ] )
13

DESCRIPTION

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 a direct or indirect member of the
19       new owning role. (Note that superusers have these privileges
20       automatically.)
21

PARAMETERS

23       name
24           The name of an existing tablespace.
25
26       new_name
27           The new name of the tablespace. The new name cannot begin with pg_,
28           as such names are reserved for system tablespaces.
29
30       new_owner
31           The new owner of the tablespace.
32
33       tablespace_option
34           A tablespace parameter to be set or reset. Currently, the only
35           available parameters are seq_page_cost, random_page_cost,
36           effective_io_concurrency and maintenance_io_concurrency. Setting
37           these values for a particular tablespace will override the
38           planner's usual estimate of the cost of reading pages from tables
39           in that tablespace, and the executor's prefetching behavior, as
40           established by the configuration parameters of the same name (see
41           seq_page_cost, random_page_cost, effective_io_concurrency,
42           maintenance_io_concurrency). This may be useful if one tablespace
43           is located on a disk which is faster or slower than the remainder
44           of the I/O subsystem.
45

EXAMPLES

47       Rename tablespace index_space to fast_raid:
48
49           ALTER TABLESPACE index_space RENAME TO fast_raid;
50
51       Change the owner of tablespace index_space:
52
53           ALTER TABLESPACE index_space OWNER TO mary;
54

COMPATIBILITY

56       There is no ALTER TABLESPACE statement in the SQL standard.
57

SEE ALSO

59       CREATE TABLESPACE (CREATE_TABLESPACE(7)), DROP TABLESPACE
60       (DROP_TABLESPACE(7))
61
62
63
64PostgreSQL 13.4                      2021                  ALTER TABLESPACE(7)
Impressum