X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4BC8CD1B21B for ; Mon, 2 Aug 2004 16:05:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69801-01 for ; Mon, 2 Aug 2004 19:05:51 +0000 (GMT) Received: from devel.solutionst.com (216-107-217-154.solutionst.cust.seg.NET [216.107.217.154]) by svr1.postgresql.org (Postfix) with ESMTP id 7A879D1B1CD for ; Mon, 2 Aug 2004 16:05:48 -0300 (ADT) Received: from solutionst.com (unknown [192.168.1.96]) by devel.solutionst.com (Postfix) with ESMTP id 3D443F6902; Mon, 2 Aug 2004 15:05:52 -0400 (EDT) Message-ID: <410E9086.3060204@solutionst.com> Date: Mon, 02 Aug 2004 15:05:42 -0400 From: Bill Harper User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jodi Kanter Cc: Postgres Admin List Subject: Re: no dup rows References: <410E88D6.8050906@virginia.edu> In-Reply-To: <410E88D6.8050906@virginia.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/11 X-Sequence-Number: 14406 Jodi Kanter wrote: > I have a linking table that has only two fields in it and both are > foreign keys to other tables. I'd like to ensure that there are never > any duplicate rows in this table. I was planning on creating a > multi-column unique index to satisfy this requirement. Is there a more > appropriate way to accomplish this or am I on the right track?> > thanks. > Jodi > -- > > /_______________________________ > //Jodi L Kanter > BioInformatics Database Administrator > University of Virginia > (434) 924-2846 > jkanter@virginia.edu / > > > Just create a primary key on the two columns, that way you get uniqueness and not null constraints. -bill