summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-07-12 01:22:53 +0000
committerBruce Momjian <bruce@momjian.us>2004-07-12 01:22:53 +0000
commit7bcdf2ebee9532105c4e0991878b059c37b25dc1 (patch)
treec07f024b190d8de507d6b646f8f946ed419b64fe /doc/src
parent3095c104f01a67b57f908f2f2d6201bd60e14e26 (diff)
Tablespace examples for CREATE TABLE/INDEX/SCHEMA/DATABASE as well as
some other examples for CREATE DATABASE. Gavin Sherry
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_database.sgml22
-rw-r--r--doc/src/sgml/ref/create_index.sgml11
-rw-r--r--doc/src/sgml/ref/create_schema.sgml12
-rw-r--r--doc/src/sgml/ref/create_table.sgml14
4 files changed, 55 insertions, 4 deletions
diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml
index deb76d30f50..1c5f546bbe6 100644
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_database.sgml,v 1.39 2004/06/18 06:13:05 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_database.sgml,v 1.40 2004/07/12 01:22:53 momjian Exp $
PostgreSQL documentation
-->
@@ -171,6 +171,26 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
CREATE DATABASE lusiadas;
</programlisting>
</para>
+
+ <para>
+
+ <para>
+ To create a database <literal>sales</> owned by user <literal>salesapp</>>
+ with a default tablespace of <literal>salesspace</>:
+
+<programlisting>
+CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace;
+</programlisting>
+ </para>
+
+ <para>
+ To create a database <literal>music</> which supports the ISO-8859-1
+ character set:
+
+<programlisting>
+CREATE DATABASE music ENCODING 'LATIN1';
+</programlisting>
+ </para>
</refsect1>
<refsect1>
diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml
index 93ae0c1c816..c45df0c5be0 100644
--- a/doc/src/sgml/ref/create_index.sgml
+++ b/doc/src/sgml/ref/create_index.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.48 2004/06/18 06:13:05 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.49 2004/07/12 01:22:53 momjian Exp $
PostgreSQL documentation
-->
@@ -254,6 +254,15 @@ CREATE UNIQUE INDEX title_idx ON films (title);
</programlisting>
</para>
+ <para>
+ To create an index on the column <literal>code</> in the table
+ <literal>films</> and have the index reside in the tablespace
+ <literal>indexspace</>:
+<programlisting>
+CREATE INDEX code_idx ON films(code) TABLESPACE indexspace;
+</programlisting>
+ </para>
+
<!--
<comment>
Is this example correct?
diff --git a/doc/src/sgml/ref/create_schema.sgml b/doc/src/sgml/ref/create_schema.sgml
index 4f56341ce36..dc7584c8849 100644
--- a/doc/src/sgml/ref/create_schema.sgml
+++ b/doc/src/sgml/ref/create_schema.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_schema.sgml,v 1.13 2004/06/25 21:55:50 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_schema.sgml,v 1.14 2004/07/12 01:22:53 momjian Exp $
PostgreSQL documentation
-->
@@ -160,6 +160,16 @@ CREATE VIEW hollywood.winners AS
SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL;
</programlisting>
</para>
+
+ <para>
+ Create a schema <literal>sales</> whose tables, indexes and sequences
+ will be stored in the tablespace <literal>mirrorspace</> by default:
+
+<programlisting>
+CREATE SCHEMA sales TABLESPACE mirrorspace;
+</programlisting>
+ </para>
+
</refsect1>
<refsect1>
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 40462752f11..31f5d147879 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.82 2004/06/18 06:13:05 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.83 2004/07/12 01:22:53 momjian Exp $
PostgreSQL documentation
-->
@@ -824,6 +824,18 @@ CREATE TABLE distributors (
</programlisting>
</para>
+ <para>
+ Create table <structname>cinemas</> in tablespace <structname>diskvol1</>:
+
+<programlisting>
+CREATE TABLE cinemas (
+ id serial,
+ name text,
+ location text
+) TABLESPACE diskvol1;
+</programlisting>
+ </para>
+
</refsect1>
<refsect1 id="SQL-CREATETABLE-compatibility">