Tablespace examples for CREATE TABLE/INDEX/SCHEMA/DATABASE as well as
authorBruce Momjian
Mon, 12 Jul 2004 01:22:53 +0000 (01:22 +0000)
committerBruce Momjian
Mon, 12 Jul 2004 01:22:53 +0000 (01:22 +0000)
some other examples for CREATE DATABASE.

Gavin Sherry

doc/src/sgml/ref/create_database.sgml
doc/src/sgml/ref/create_index.sgml
doc/src/sgml/ref/create_schema.sgml
doc/src/sgml/ref/create_table.sgml

index deb76d30f5072d059ba8dae1011d3d4d9ea33339..1c5f546bbe6e1f5476acdf9441586309bffed275 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -169,6 +169,26 @@ CREATE DATABASE name
 
 
 CREATE DATABASE lusiadas;
+
+  
+
+  
+
+  
+   To create a database sales owned by user salesapp>
+   with a default tablespace of salesspace:
+
+
+CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace;
+
+  
+
+  
+   To create a database music which supports the ISO-8859-1 
+   character set:
+
+
+CREATE DATABASE music ENCODING 'LATIN1';
 
   
  
index 93ae0c1c8165e698d295e3c3306997bf50c37ec6..c45df0c5be058933398aa53c32f84f9aab3e7109 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -251,6 +251,15 @@ CREATE [ UNIQUE ] INDEX name ON 
    the table films:
 
 CREATE UNIQUE INDEX title_idx ON films (title);
+
+  
+
+  
+   To create an index on the column code in the table
+   films and have the index reside in the tablespace
+   indexspace:
+
+CREATE INDEX code_idx ON films(code) TABLESPACE indexspace;
 
   
 
index 4f56341ce361a296e89c81e2809ec4863e0d4969..dc7584c8849b3b12c8e7ad026644c67da07be208 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -160,6 +160,16 @@ CREATE VIEW hollywood.winners AS
     SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL;
 
   
+
+  
+   Create a schema sales whose tables, indexes and sequences
+   will be stored in the tablespace mirrorspace by default:
+
+
+CREATE SCHEMA sales TABLESPACE mirrorspace;
+
+  
+
  
 
  
index 40462752f11adfa2cc8f16ccf4321d966abef088..31f5d1478795b3208a4c86d32d022e6429de5763 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -821,6 +821,18 @@ CREATE TABLE distributors (
     name    varchar(40),
     UNIQUE(name)
 );
+
+  
+
+  
+   Create table cinemas in tablespace diskvol1:
+
+
+CREATE TABLE cinemas (
+   id serial,
+   name text,
+   location text
+) TABLESPACE diskvol1;