Skip to content

Commit bf4507e

Browse files
committed
I think it's important that it's actually documented that they can add
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
1 parent a966ac1 commit bf4507e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/src/sgml/ref/alter_table.sgml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.36 2002/02/16 23:45:48 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.37 2002/02/17 11:50:09 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -295,6 +295,15 @@ ALTER TABLE distributors ADD CONSTRAINT dist_id_zipcode_key UNIQUE (dist_id, zip
295295
</para>
296296
</refsect1>
297297

298+
<para>
299+
To add an automatically named primary key constraint to a table, noting
300+
that a table can only ever have one primary key:
301+
<programlisting>
302+
ALTER TABLE distributors ADD PRIMARY KEY (dist_id);
303+
</programlisting>
304+
</para>
305+
</refsect1>
306+
298307
<refsect1 id="R1-SQL-ALTERTABLE-3">
299308
<title>
300309
Compatibility

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy