Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 502DD476033 for ; Sat, 5 Oct 2002 10:14:45 -0400 (EDT) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by postgresql.org (Postfix) with ESMTP id C15B2475F27 for ; Sat, 5 Oct 2002 10:14:44 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 17xphg-0001Ir-0U; Sat, 05 Oct 2002 15:14:48 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 70E8417493; Sat, 5 Oct 2002 15:13:13 +0100 (BST) Received: from archonet.com (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with SMTP id DC1CE165CB; Sat, 5 Oct 2002 15:13:12 +0100 (BST) Received: from 192.168.1.32 (SquirrelMail authenticated user dev) by mainbox.archonet.com with HTTP; Sat, 5 Oct 2002 15:13:12 +0100 (BST) Message-ID: <49201.192.168.1.32.1033827192.squirrel@mainbox.archonet.com> Date: Sat, 5 Oct 2002 15:13:12 +0100 (BST) Subject: Re: enforcing with unique indexes.. From: To: In-Reply-To: <200210051219.07553.mallah@trade-india.com> References: <200210051219.07553.mallah@trade-india.com> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: X-Mailer: SquirrelMail (version 1.2.7) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/72 X-Sequence-Number: 9790 > > ie i want 1 to 1 mapping between group_id and userid so that , there > shud not be a single group_id having more that one kind of userid. > > can it be done with some sort of UNIQUE INDEX? If you want multiple groups but the user should always be the same 1 1 ok 1 1 ok 2 1 ok 3 2 ok 3 3 bad Perhaps you should normalise a bit further with a separate group_user table - you could restrict that to being unique on group then. - Richard Huxton