]> begriffs open source - ai-pg/blob - full-docs/txt/sql-altertablespace.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-altertablespace.txt
1
2 ALTER TABLESPACE
3
4    ALTER TABLESPACE — change the definition of a tablespace
5
6 Synopsis
7
8 ALTER TABLESPACE name RENAME TO new_name
9 ALTER TABLESPACE name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSI
10 ON_USER }
11 ALTER TABLESPACE name SET ( tablespace_option = value [, ... ] )
12 ALTER TABLESPACE name RESET ( tablespace_option [, ... ] )
13
14 Description
15
16    ALTER TABLESPACE can be used to change the definition of a tablespace.
17
18    You must own the tablespace to change the definition of a tablespace.
19    To alter the owner, you must also be able to SET ROLE to the new owning
20    role. (Note that superusers have these privileges automatically.)
21
22 Parameters
23
24    name
25           The name of an existing tablespace.
26
27    new_name
28           The new name of the tablespace. The new name cannot begin with
29           pg_, as such names are reserved for system tablespaces.
30
31    new_owner
32           The new owner of the tablespace.
33
34    tablespace_option
35           A tablespace parameter to be set or reset. Currently, the only
36           available parameters are seq_page_cost, random_page_cost,
37           effective_io_concurrency and maintenance_io_concurrency. Setting
38           these values for a particular tablespace will override the
39           planner's usual estimate of the cost of reading pages from
40           tables in that tablespace, and how many concurrent I/Os are
41           issued, as established by the configuration parameters of the
42           same name (see seq_page_cost, random_page_cost,
43           effective_io_concurrency, maintenance_io_concurrency). This may
44           be useful if one tablespace is located on a disk which is faster
45           or slower than the remainder of the I/O subsystem.
46
47 Examples
48
49    Rename tablespace index_space to fast_raid:
50 ALTER TABLESPACE index_space RENAME TO fast_raid;
51
52    Change the owner of tablespace index_space:
53 ALTER TABLESPACE index_space OWNER TO mary;
54
55 Compatibility
56
57    There is no ALTER TABLESPACE statement in the SQL standard.
58
59 See Also
60
61    CREATE TABLESPACE, DROP TABLESPACE