11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.128 2010/06/07 02:59:02 itagaki Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.129 2010/07/25 23:21:21 rhaas Exp $
33PostgreSQL documentation
44-->
55
@@ -21,7 +21,7 @@ PostgreSQL documentation
2121
2222 <refsynopsisdiv>
2323<synopsis>
24- CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PARAMETER">table_name</replaceable> ( [
24+ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE[ IF NOT EXISTS ] <replaceable class="PARAMETER">table_name</replaceable> ( [
2525 { <replaceable class="PARAMETER">column_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [ DEFAULT <replaceable>default_expr</replaceable> ] [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
2626 | <replaceable>table_constraint</replaceable>
2727 | LIKE <replaceable>parent_table</replaceable> [ <replaceable>like_option</replaceable> ... ] }
@@ -32,7 +32,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PAR
3232[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
3333[ TABLESPACE <replaceable class="PARAMETER">tablespace</replaceable> ]
3434
35- CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PARAMETER">table_name</replaceable>
35+ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE[ IF NOT EXISTS ] <replaceable class="PARAMETER">table_name</replaceable>
3636 OF <replaceable class="PARAMETER">type_name</replaceable> [ (
3737 { <replaceable class="PARAMETER">column_name</replaceable> WITH OPTIONS [ DEFAULT <replaceable>default_expr</replaceable> ] [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
3838 | <replaceable>table_constraint</replaceable> }
@@ -163,6 +163,18 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PAR
163163 </listitem>
164164 </varlistentry>
165165
166+ <varlistentry>
167+ <term><literal>IF NOT EXISTS</></term>
168+ <listitem>
169+ <para>
170+ Do not throw an error if a relation with the same name already exists.
171+ A notice is issued in this case. Note that there is no guarantee that
172+ the existing relation is anything like the one that would have been
173+ created.
174+ </para>
175+ </listitem>
176+ </varlistentry>
177+
166178 <varlistentry>
167179 <term><replaceable class="PARAMETER">table_name</replaceable></term>
168180 <listitem>