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 C40B4D1B258 for ; Mon, 2 Aug 2004 16:02:02 -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 62939-09 for ; Mon, 2 Aug 2004 19:01:58 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id D86F9D1B248 for ; Mon, 2 Aug 2004 16:01:54 -0300 (ADT) Received: (qmail 10861 invoked by uid 65534); 2 Aug 2004 19:01:55 -0000 Received: from dsl-082-082-234-070.arcor-ip.net (EHLO colt.pezone.net) (82.82.234.70) by mail.gmx.net (mp024) with SMTP; 02 Aug 2004 21:01:55 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: Jodi Kanter , Postgres Admin List Subject: Re: no dup rows Date: Mon, 2 Aug 2004 21:01:44 +0200 User-Agent: KMail/1.5.1 References: <410E88D6.8050906@virginia.edu> In-Reply-To: <410E88D6.8050906@virginia.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200408022101.44412.peter_e@gmx.net> 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/10 X-Sequence-Number: 14405 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?> In "linking tables" you should usually make the entire set of columns the primary key. This would solve your problem. -- Peter Eisentraut http://developer.postgresql.org/~petere/