Home Explore Blog CI



postgresql

1st chunk of `doc/src/sgml/ref/alter_tablespace.sgml`
e1350ff4bf22f92e50b37fd2d983a3e59a69cdbcb21ee01e0000000100000845
<!--
doc/src/sgml/ref/alter_tablespace.sgml
PostgreSQL documentation
-->

<refentry id="sql-altertablespace">
 <indexterm zone="sql-altertablespace">
  <primary>ALTER TABLESPACE</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>ALTER TABLESPACE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>ALTER TABLESPACE</refname>
  <refpurpose>change the definition of a tablespace</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
ALTER TABLESPACE <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
ALTER TABLESPACE <replaceable>name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER TABLESPACE <replaceable>name</replaceable> SET ( <replaceable class="parameter">tablespace_option</replaceable> = <replaceable class="parameter">value</replaceable> [, ... ] )
ALTER TABLESPACE <replaceable>name</replaceable> RESET ( <replaceable class="parameter">tablespace_option</replaceable> [, ... ] )
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>ALTER TABLESPACE</command> can be used to change the definition of
   a tablespace.
  </para>

  <para>
   You must own the tablespace to change the definition of a tablespace.
   To alter the owner, you must also be able to <literal>SET ROLE</literal>
   to the new owning role.
   (Note that superusers have these privileges automatically.)
  </para>

 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">name</replaceable></term>
    <listitem>
     <para>
      The name of an existing tablespace.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_name</replaceable></term>
    <listitem>
     <para>
      The new name of the tablespace.  The new name cannot
      begin with <literal>pg_</literal>, as such names
      are reserved for system tablespaces.
     </para>
    </listitem>
   </varlistentry>

Title: ALTER TABLESPACE: Change Tablespace Definition
Summary
The ALTER TABLESPACE command allows modifying the definition of an existing tablespace. This includes renaming the tablespace, changing its owner, and setting or resetting tablespace options. You must own the tablespace to modify it, and altering the owner requires the ability to SET ROLE to the new owner.