Re: no dup rows

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jodi Kanter <jkanter(at)virginia(dot)edu>, Postgres Admin List <pgsql-admin(at)postgresql(dot)org>
Subject: Re: no dup rows
Date: 2004-08-02 19:01:44
Message-ID: 200408022101.44412.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bill Harper 2004-08-02 19:05:42 Re: no dup rows
Previous Message Jodi Kanter 2004-08-02 18:32:54 no dup rows