head	1.11;
access;
symbols
	REL9_0_0:1.11
	REL9_1_ALPHA1:1.11
	REL9_0_RC1:1.11
	REL9_0_BETA4:1.11
	REL9_0_STABLE:1.11.0.2
	REL9_0_BETA3:1.11
	REL9_0_BETA2:1.11
	REL8_0_25:1.5
	REL8_1_21:1.5
	REL8_2_17:1.7
	REL8_3_11:1.8
	REL8_4_4:1.9
	REL9_0_BETA1:1.11
	REL9_0_ALPHA5_BRANCH:1.10.0.8
	REL9_0_ALPHA5:1.10
	REL8_0_24:1.5
	REL8_1_20:1.5
	REL8_2_16:1.7
	REL8_3_10:1.8
	REL8_4_3:1.9
	REL9_0_ALPHA4:1.10
	REL9_0_ALPHA4_BRANCH:1.10.0.6
	REL8_5_ALPHA3:1.10
	REL8_5_ALPHA3_BRANCH:1.10.0.4
	REL8_0_23:1.5
	REL8_1_19:1.5
	REL8_2_15:1.7
	REL8_3_9:1.8
	REL8_4_2:1.9
	REL8_5_ALPHA2:1.10
	REL8_5_ALPHA2_BRANCH:1.10.0.2
	REL8_0_22:1.5
	REL8_1_18:1.5
	REL8_2_14:1.7
	REL8_3_8:1.8
	REL8_4_1:1.9
	REL8_5_ALPHA1:1.9
	REL8_5_ALPHA1_BRANCH:1.9.0.4
	REL8_4_STABLE:1.9.0.2
	REL8_4_0:1.9
	REL8_4_RC2:1.9
	REL8_4_RC1:1.9
	REL8_4_BETA2:1.9
	REL8_4_BETA1:1.9
	REL8_0_21:1.5
	REL8_1_17:1.5
	REL8_2_13:1.7
	REL8_3_7:1.8
	REL8_0_20:1.5
	REL8_1_16:1.5
	REL8_2_12:1.7
	REL8_3_6:1.8
	REL8_0_19:1.5
	REL8_1_15:1.5
	REL8_2_11:1.7
	REL8_3_5:1.8
	REL8_0_18:1.5
	REL8_1_14:1.5
	REL8_2_10:1.7
	REL8_3_4:1.8
	REL8_0_17:1.5
	REL8_1_13:1.5
	REL8_2_9:1.7
	REL8_3_3:1.8
	REL8_0_16:1.5
	REL8_1_12:1.5
	REL8_2_8:1.7
	REL8_3_2:1.8
	REL8_2_7:1.7
	REL8_3_1:1.8
	REL8_3_STABLE:1.8.0.2
	REL8_3_0:1.8
	REL8_3_RC2:1.8
	REL8_0_15:1.5
	REL8_1_11:1.5
	REL8_2_6:1.7
	REL8_3_RC1:1.8
	REL8_3_BETA4:1.8
	REL8_3_BETA3:1.8
	REL8_3_BETA2:1.8
	REL8_3_BETA1:1.8
	REL8_0_14:1.5
	REL8_1_10:1.5
	REL8_2_5:1.7
	REL8_0_13:1.5
	REL8_1_9:1.5
	REL8_2_4:1.7
	REL8_0_12:1.5
	REL8_1_8:1.5
	REL8_2_3:1.7
	REL8_0_11:1.5
	REL8_1_7:1.5
	REL8_2_2:1.7
	REL8_0_10:1.5
	REL8_1_6:1.5
	REL8_2_1:1.7
	REL8_2_STABLE:1.7.0.2
	REL8_2_0:1.7
	REL8_2_RC1:1.7
	REL8_2_BETA3:1.7
	REL8_2_BETA2:1.6
	REL8_1_5:1.5
	REL8_0_9:1.5
	REL8_2_BETA1:1.6
	REL8_0_8:1.5
	REL8_1_4:1.5
	REL8_0_7:1.5
	REL8_1_3:1.5
	REL8_0_6:1.5
	REL8_1_2:1.5
	REL8_0_5:1.5
	REL8_1_1:1.5
	REL8_1_STABLE:1.5.0.6
	REL8_1_0:1.5
	REL8_1_0RC1:1.5
	REL8_1_0BETA4:1.5
	REL8_1_0BETA3:1.5
	REL8_0_4:1.5
	REL8_1_0BETA2:1.5
	REL8_1_0BETA1:1.5
	REL8_0_3:1.5
	REL8_0_2:1.5
	REL8_0_1:1.5
	REL8_0_STABLE:1.5.0.4
	REL8_0_0:1.5.0.2
	REL8_0_0RC5:1.5
	REL8_0_0RC4:1.5
	REL8_0_0RC3:1.5
	REL8_0_0RC2:1.5
	REL8_0_0RC1:1.5
	REL8_0_0BETA5:1.5
	REL8_0_0BETA4:1.4
	REL8_0_0BETA3:1.4
	REL8_0_0BETA2:1.4
	REL8_0_0BETA1:1.3;
locks; strict;
comment	@# @;


1.11
date	2010.04.03.07.23.00;	author petere;	state Exp;
branches;
next	1.10;

1.10
date	2009.09.19.10.23.27;	author petere;	state Exp;
branches;
next	1.9;

1.9
date	2008.11.14.10.22.46;	author petere;	state Exp;
branches;
next	1.8;

1.8
date	2007.01.31.23.26.03;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	2006.10.31.01.52.31;	author neilc;	state Exp;
branches;
next	1.6;

1.6
date	2006.09.16.00.30.17;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	2004.11.05.19.15.51;	author tgl;	state Exp;
branches;
next	1.4;

1.4
date	2004.08.24.00.06.51;	author neilc;	state Exp;
branches;
next	1.3;

1.3
date	2004.08.02.04.25.37;	author tgl;	state Exp;
branches;
next	1.2;

1.2
date	2004.06.25.21.55.50;	author tgl;	state Exp;
branches;
next	1.1;

1.1
date	2004.06.18.06.13.05;	author tgl;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Remove unnecessary xref endterm attributes and title ids

The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
@
text
@<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_tablespace.sgml,v 1.10 2009/09/19 10:23:27 petere Exp $
PostgreSQL documentation
-->

<refentry id="SQL-CREATETABLESPACE">
 <refmeta>
  <refentrytitle>CREATE TABLESPACE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>CREATE TABLESPACE</refname>
  <refpurpose>define a new tablespace</refpurpose>
 </refnamediv>

 <indexterm zone="sql-createtablespace">
  <primary>CREATE TABLESPACE</primary>
 </indexterm>

 <refsynopsisdiv>
<synopsis>
CREATE TABLESPACE <replaceable class="parameter">tablespace_name</replaceable> [ OWNER <replaceable class="parameter">user_name</replaceable> ] LOCATION '<replaceable class="parameter">directory</replaceable>'
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>CREATE TABLESPACE</command> registers a new cluster-wide
   tablespace.  The tablespace name must be distinct from the name of any
   existing tablespace in the database cluster.
  </para>

  <para>
   A tablespace allows superusers to define an alternative location on
   the file system where the data files containing database objects
   (such as tables and indexes) can reside.
  </para>

  <para>
   A user with appropriate privileges can pass
   <replaceable class="parameter">tablespace_name</> to
   <command>CREATE DATABASE</>, <command>CREATE TABLE</>,
   <command>CREATE INDEX</> or <command>ADD CONSTRAINT</> to have the data
   files for these objects stored within the specified tablespace.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

    <variablelist>
     <varlistentry>
      <term><replaceable class="parameter">tablespace_name</replaceable></term>
      <listitem>
       <para>
        The name of a tablespace to be created.  The name cannot
        begin with <literal>pg_</literal>, as such names
        are reserved for system tablespaces.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">user_name</replaceable></term>
      <listitem>
       <para>
        The name of the user who will own the tablespace.  If omitted,
        defaults to the user executing the command.  Only superusers
        can create tablespaces, but they can assign ownership of tablespaces
        to non-superusers.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">directory</replaceable></term>
      <listitem>
       <para>
        The directory that will be used for the tablespace. The directory
        must be empty and must be owned by the
        <productname>PostgreSQL</> system user.  The directory must be
        specified by an absolute path name.
       </para>
      </listitem>
     </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   Tablespaces are only supported on systems that support symbolic links.
  </para>

   <para>
    <command>CREATE TABLESPACE</> cannot be executed inside a transaction
    block.
   </para>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   Create a tablespace <literal>dbspace</> at <literal>/data/dbs</>:
<programlisting>
CREATE TABLESPACE dbspace LOCATION '/data/dbs';
</programlisting>
  </para>

  <para>
   Create a tablespace <literal>indexspace</> at <literal>/data/indexes</>
   owned by user <literal>genevieve</>:
<programlisting>
CREATE TABLESPACE indexspace OWNER genevieve LOCATION '/data/indexes';
</programlisting>
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   <command>CREATE TABLESPACE</command> is a <productname>PostgreSQL</>
   extension.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-createdatabase"></member>
   <member><xref linkend="sql-createtable"></member>
   <member><xref linkend="sql-createindex"></member>
   <member><xref linkend="sql-droptablespace"></member>
   <member><xref linkend="sql-altertablespace"></member>
  </simplelist>
 </refsect1>

</refentry>
@


1.10
log
@Make the placeholder naming in the synopses of the SQL help more consistent
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/create_tablespace.sgml,v 1.9 2008/11/14 10:22:46 petere Exp $
d8 1
a8 1
  <refentrytitle id="sql-createtablespace-title">CREATE TABLESPACE</refentrytitle>
d138 5
a142 5
   <member><xref linkend="sql-createdatabase" endterm="sql-createdatabase-title"></member>
   <member><xref linkend="sql-createtable" endterm="sql-createtable-title"></member>
   <member><xref linkend="sql-createindex" endterm="sql-createindex-title"></member>
   <member><xref linkend="sql-droptablespace" endterm="sql-droptablespace-title"></member>
   <member><xref linkend="sql-altertablespace" endterm="sql-altertablespace-title"></member>
@


1.9
log
@Set SQL man pages to be section 7 by default, and only transform them to
another section if required by the platform (instead of the old way of
building them in section "l" and always transforming them to the
platform-specific section).

This speeds up the installation on common platforms, and it avoids some
funny business with the man page tools and build process.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/create_tablespace.sgml,v 1.8 2007/01/31 23:26:03 momjian Exp $
d24 1
a24 1
CREATE TABLESPACE <replaceable class="parameter">tablespacename</replaceable> [ OWNER <replaceable class="parameter">username</replaceable> ] LOCATION '<replaceable class="parameter">directory</replaceable>'
d45 1
a45 1
   <replaceable class="parameter">tablespacename</> to
d57 1
a57 1
      <term><replaceable class="parameter">tablespacename</replaceable></term>
d68 1
a68 1
      <term><replaceable class="parameter">username</replaceable></term>
@


1.8
log
@Update reference documentation on may/can/might:

Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/create_tablespace.sgml,v 1.7 2006/10/31 01:52:31 neilc Exp $
d9 1
@


1.7
log
@Add text to the VACUUM, REINDEX, DROP TABLESPACE and CREATE TABLESPACE
reference pages documenting that these commands cannot be used within
a transaction block. Also make some minor improvements to the psql
reference page. Patch from Simon Riggs, minor editorialization by
myself.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/create_tablespace.sgml,v 1.6 2006/09/16 00:30:17 momjian Exp $
d39 1
a39 1
   (such as tables and indexes) may reside.
d72 1
a72 1
        may create tablespaces, but they can assign ownership of tablespaces
@


1.6
log
@Remove emacs info from footer of SGML files.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/create_tablespace.sgml,v 1.5 2004/11/05 19:15:51 tgl Exp $
d98 5
@


1.5
log
@Create 'default_tablespace' GUC variable that supplies a TABLESPACE
clause implicitly whenever one is not given explicitly.  Remove concept
of a schema having an associated tablespace, and simplify the rules for
selecting a default tablespace for a table or index.  It's now just
(a) explicit TABLESPACE clause; (b) default_tablespace if that's not an
empty string; (c) database's default.  This will allow pg_dump to use
SET commands instead of tablespace clauses to determine object locations
(but I didn't actually make it do so).  All per recent discussions.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/create_tablespace.sgml,v 1.4 2004/08/24 00:06:51 neilc Exp $
a140 17

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->
@


1.4
log
@Various minor improvements to the SGML documentation: fix some incorrect
SGML markup, add a "deprecated features" section to the 8.0 release
notes, untabify release.sgml and runtime.sgml, and make some other
minor improvements.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/create_tablespace.sgml,v 1.3 2004/08/02 04:25:37 tgl Exp $
d44 2
a45 2
   <replaceable class="parameter">tablespacename</> to <command>CREATE
   DATABASE</>, <command>CREATE SCHEMA</>, <command>CREATE TABLE</>,
a132 1
   <member><xref linkend="sql-createschema" endterm="sql-createschema-title"></member>
@


1.3
log
@Support USING INDEX TABLESPACE clause for PRIMARY KEY and UNIQUE
constraints.  Christopher Kings-Lynne.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/create_tablespace.sgml,v 1.2 2004/06/25 21:55:50 tgl Exp $
d37 2
a38 2
   A tablespace allows superusers to define an alternative location on the
   file system where the data files representing database objects
@


1.2
log
@Support renaming of tablespaces, and changing the owners of
aggregates, conversions, functions, operators, operator classes,
schemas, types, and tablespaces.  Fold the existing implementations
of alter domain owner and alter database owner in with these.

Christopher Kings-Lynne
@
text
@d2 1
a2 1
$PostgreSQL: pgsql-server/doc/src/sgml/ref/create_tablespace.sgml,v 1.1 2004/06/18 06:13:05 tgl Exp $
d46 1
a46 1
   <command>CREATE INDEX</> or <command>CREATE SEQUENCE</> to have the data
a135 1
   <member><xref linkend="sql-createsequence" endterm="sql-createsequence-title"></member>
@


1.1
log
@Tablespaces.  Alternate database locations are dead, long live tablespaces.

There are various things left to do: contrib dbsize and oid2name modules
need work, and so does the documentation.  Also someone should think about
COMMENT ON TABLESPACE and maybe RENAME TABLESPACE.  Also initlocation is
dead, it just doesn't know it yet.

Gavin Sherry and Tom Lane.
@
text
@d2 1
a2 1
$PostgreSQL$
d59 3
a61 1
        The name of a tablespace to be created.
d138 1
@

