UNIQUE constraint

From: Sascha Ziemann <ziemann(at)secunet(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: UNIQUE constraint
Date: 2004-08-06 18:25:02
Message-ID: m37jscdszl.fsf@sn-e0310.ek.secunet.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I have a question about the UNIQUE constraint. The documentation
describes this example:

CREATE TABLE example (
a integer,
b integer,
c integer,
UNIQUE (a, c)
);

But it is not clean to me. Does the above example mean that the list
of pairs must be unique or is it only a short version for this
constraint:

CREATE TABLE example (
a integer UNIQUE,
b integer,
c integer UNIQUE
);

Does the following table fullfill the UNIQUE clause of the example
from the Postgres documentation?

a b c
-----
1 2 3
1 1 1

cu Sascha

--
secunet Security Networks AG, Im Teelbruch 116, 45219 Essen
Tel: +49-2054-123-408 Fax: +49-2054-123-123
PGP: FBE2 A49B 6526 C1B4 7F10 24E4 5004 7C27 6E9A 9698

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Caleb Simonyi-Gindele 2004-08-06 21:29:10 Grouping by week
Previous Message Gordon Ross 2004-08-06 15:29:19 Make a column case insensitive