I think it's important that it's actually documented that they can add
authorBruce Momjian <[email protected]>
Sun, 17 Feb 2002 11:50:09 +0000 (11:50 +0000)
committerBruce Momjian <[email protected]>
Sun, 17 Feb 2002 11:50:09 +0000 (11:50 +0000)
primary keys after the fact!

Also, we need to add regression tests for alter table / add primary key
and alter table / drop constraint.  These shouldn't be added until 7.3
tho
methinks...

Chris

doc/src/sgml/ref/alter_table.sgml

index 408d7064fb9b8044413ce0672d82448e578c8316..22d23862f8ff422a74a234a27476fc312ec004a2 100644 (file)
@@ -295,6 +295,15 @@ ALTER TABLE distributors ADD CONSTRAINT dist_id_zipcode_key UNIQUE (dist_id, zip
   </para>
  </refsect1>
 
+  <para> 
+   To add an automatically named primary key constraint to a table, noting
+   that a table can only ever have one primary key:
+   <programlisting>
+ALTER TABLE distributors ADD PRIMARY KEY (dist_id);
+   </programlisting>
+  </para>
+ </refsect1>
+
  <refsect1 id="R1-SQL-ALTERTABLE-3">
   <title>
    Compatibility