Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bcdf2e

Browse files
committed
Tablespace examples for CREATE TABLE/INDEX/SCHEMA/DATABASE as well as
some other examples for CREATE DATABASE.Gavin Sherry
1 parent3095c10 commit7bcdf2e

File tree

4 files changed

+55
-4
lines changed

4 files changed

+55
-4
lines changed

‎doc/src/sgml/ref/create_database.sgml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_database.sgml,v 1.39 2004/06/18 06:13:05 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_database.sgml,v 1.40 2004/07/12 01:22:53 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -169,6 +169,26 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
169169

170170
<programlisting>
171171
CREATE DATABASE lusiadas;
172+
</programlisting>
173+
</para>
174+
175+
<para>
176+
177+
<para>
178+
To create a database <literal>sales</> owned by user <literal>salesapp</>>
179+
with a default tablespace of <literal>salesspace</>:
180+
181+
<programlisting>
182+
CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace;
183+
</programlisting>
184+
</para>
185+
186+
<para>
187+
To create a database <literal>music</> which supports the ISO-8859-1
188+
character set:
189+
190+
<programlisting>
191+
CREATE DATABASE music ENCODING 'LATIN1';
172192
</programlisting>
173193
</para>
174194
</refsect1>

‎doc/src/sgml/ref/create_index.sgml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.48 2004/06/18 06:13:05 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.49 2004/07/12 01:22:53 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -251,6 +251,15 @@ CREATE [ UNIQUE ] INDEX <replaceable class="parameter">name</replaceable> ON <re
251251
the table <literal>films</literal>:
252252
<programlisting>
253253
CREATE UNIQUE INDEX title_idx ON films (title);
254+
</programlisting>
255+
</para>
256+
257+
<para>
258+
To create an index on the column <literal>code</> in the table
259+
<literal>films</> and have the index reside in the tablespace
260+
<literal>indexspace</>:
261+
<programlisting>
262+
CREATE INDEX code_idx ON films(code) TABLESPACE indexspace;
254263
</programlisting>
255264
</para>
256265

‎doc/src/sgml/ref/create_schema.sgml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_schema.sgml,v 1.13 2004/06/25 21:55:50 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_schema.sgml,v 1.14 2004/07/12 01:22:53 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -160,6 +160,16 @@ CREATE VIEW hollywood.winners AS
160160
SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL;
161161
</programlisting>
162162
</para>
163+
164+
<para>
165+
Create a schema <literal>sales</> whose tables, indexes and sequences
166+
will be stored in the tablespace <literal>mirrorspace</> by default:
167+
168+
<programlisting>
169+
CREATE SCHEMA sales TABLESPACE mirrorspace;
170+
</programlisting>
171+
</para>
172+
163173
</refsect1>
164174

165175
<refsect1>

‎doc/src/sgml/ref/create_table.sgml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.82 2004/06/18 06:13:05 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.83 2004/07/12 01:22:53 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -821,6 +821,18 @@ CREATE TABLE distributors (
821821
name varchar(40),
822822
UNIQUE(name)
823823
);
824+
</programlisting>
825+
</para>
826+
827+
<para>
828+
Create table <structname>cinemas</> in tablespace <structname>diskvol1</>:
829+
830+
<programlisting>
831+
CREATE TABLE cinemas (
832+
id serial,
833+
name text,
834+
location text
835+
) TABLESPACE diskvol1;
824836
</programlisting>
825837
</para>
826838

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp