Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf4507e

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 keyand alter table / drop constraint. These shouldn't be added until 7.3thomethinks...Chris
1 parenta966ac1 commitbf4507e

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)

[8]ページ先頭

©2009-2025 Movatter.jp