Commit f947bbb3 authored by Bruce Momjian's avatar Bruce Momjian

Attached is are diffs for CREATE/ALTER table doc I've

    forgotten in my mailbox (sorry). Haven't tried to  apply  and
    since I don't have working sgml stuff cannot check.

Jan
parent bdf6c4f0
......@@ -181,6 +181,8 @@ The original name of the software at Berkeley was Postgres. When SQL
functionality was added in 1995, its name was changed to Postgres95. The
name was changed at the end of 1996 to PostgreSQL.<P>
It is pronounced <I>Post-Gres-Q-L.</I>
<H4><A NAME="1.2">1.2</A>) What's the copyright on
PostgreSQL?</H4><P>
......
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.11 2000/03/27 17:14:42 thomas Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.12 2000/04/11 14:43:54 momjian Exp $
Postgres documentation
-->
......@@ -34,6 +34,8 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable> [ * ]
class="PARAMETER">newcolumn</replaceable>
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
RENAME TO <replaceable class="PARAMETER">newtable</replaceable>
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
ADD <replaceable class="PARAMETER">table constraint definition</replaceable>
</synopsis>
<refsect2 id="R2-SQL-ALTERTABLE-1">
......@@ -89,6 +91,15 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="PARAMETER"> table constraint definition </replaceable></term>
<listitem>
<para>
New table constraint for the table
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>
......@@ -144,6 +155,9 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
the affected table. Thus, the table or column will
remain of the same type and size after this command is
executed.
The ADD <replaceable class="PARAMETER">table constraint definition</replaceable> clause
adds a new constraint to the table using the same syntax as <xref
linkend="SQL-CREATETABLE" endterm="SQL-CREATETABLE-title">.
</para>
<para>
......@@ -188,6 +202,16 @@ SELECT <replaceable>NewColumn</replaceable> FROM <replaceable>SuperClass</replac
endterm="sql-update-title">.)
</para>
<para>
In the current implementation, only FOREIGN KEY constraints can
be added to a table. To create or remove a unique constraint, create
a unique index (see <xref linkend="SQL-CREATEINDEX"
endterm="SQL-CREATEINDEX-title">). To add check constraints
you need to recreate and reload the table, using other
parameters to the <xref linkend="SQL-CREATETABLE"
endterm="SQL-CREATETABLE-title"> command.
</para>
<para>
You must own the class in order to change its schema.
Renaming any part of the schema of a system
......@@ -227,6 +251,13 @@ ALTER TABLE distributors RENAME COLUMN address TO city;
ALTER TABLE distributors RENAME TO suppliers;
</programlisting>
</para>
<para>
To add a foreign key constraint to a table:
<programlisting>
ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses(address) MATCH FULL
</programlisting>
</para>
</refsect1>
<refsect1 id="R1-SQL-ALTERTABLE-3">
......@@ -253,17 +284,15 @@ ALTER TABLE distributors RENAME TO suppliers;
<varlistentry>
<term>
<synopsis>
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> ADD <replaceable class="PARAMETER">table constraint definition</replaceable>
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> { RESTRICT | CASCADE }
</synopsis>
</term>
<listitem>
<para>
Adds or removes a table constraint (such as a check constraint,
unique constraint, or foreign key constraint). To create
or remove a unique constraint, create or drop a unique index,
respectively (see <xref linkend="SQL-CREATEINDEX" endterm="SQL-CREATEINDEX-title">).
To change other kinds of constraints you need to recreate
Removes a table constraint (such as a check constraint,
unique constraint, or foreign key constraint). To
remove a unique constraint, drop a unique index,
To remove other kinds of constraints you need to recreate
and reload the table, using other parameters to the
<xref linkend="SQL-CREATETABLE" endterm="SQL-CREATETABLE-title">
command.
......
This diff is collapsed.
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.16 2000/04/04 05:22:45 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.17 2000/04/11 14:43:54 momjian Exp $
Postgres documentation
-->
......@@ -362,6 +362,16 @@ dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
Large objects are ignored and must be dealt with manually.
</para>
</listitem>
<listitem>
<para>
When doing a data only dump, <application>pg_dump</application> emits queries
to disable triggers on user tables before inserting the data and queries to
reenable them after the data has been inserted. If the restore is stopped
in the middle, the system catalogs may be left in the wrong state.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment