Received: from mail_dns.lagoon.nc (mail.offratel.nc [209.58.55.28]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA36045; Tue, 14 Sep 1999 14:16:13 -0400 (EDT) (envelope-from fillons@offratel.nc) Received: from portable (unverified [209.58.55.166]) by mail_dns.lagoon.nc (Rockliffe SMTPRA 3.4.3) with SMTP id ; Wed, 15 Sep 1999 05:17:00 +1100 Message-ID: <000f01befedd$3f26fda0$a6373ad1@portable> From: "=?iso-8859-1?Q?St=E9phane_FILLON?=" To: "pgsql-sql" , "pgsql-hackers" , "pgsql-general" Subject: BUG with UNIQUE clause Date: Wed, 15 Sep 1999 05:14:15 +1100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000B_01BEFF39.27AFBD40" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 This is a multi-part message in MIME format. ------=_NextPart_000_000B_01BEFF39.27AFBD40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, The UNIQUE constraint doesn't work on a field if I use a DEFAULT clause = on a table. The following table works with UNIQUE constraint: create table cltclt001( tcid int2, tcnom text unique ); but this one accept several same tcnom value: create table cltclt001( tcid int2 default nextval('cltcls001'), tcnom text unique ); What's wrong with my table ? Thanks in advance. Stephane FILLON ------=_NextPart_000_000B_01BEFF39.27AFBD40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
The UNIQUE constraint doesn't work = on a field if=20 I use a DEFAULT clause on a table.
 
The following table works with = UNIQUE=20 constraint:
 
create table cltclt001(
  tcid int2,
  tcnom text = unique
);
 
but this one accept several same = tcnom=20 value:
 
create table cltclt001(
  tcid int2 default=20 nextval('cltcls001'),
  tcnom text = unique
);
 
 
What's wrong with my table ?
 
Thanks in advance.
 
Stephane FILLON
------=_NextPart_000_000B_01BEFF39.27AFBD40--