pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bill Harper <bharper@solutionst.com>
To: Jodi Kanter <jkanter@virginia.edu>
Cc: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: no dup rows
Date: Mon, 02 Aug 2004 15:05:42 -0400
Message-ID: <410E9086.3060204@solutionst.com> (raw)
In-Reply-To: <410E88D6.8050906@virginia.edu>
References: <410E88D6.8050906@virginia.edu>

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 <mailto:jkanter@virginia.edu100>/
>
>  
>
Just create a primary key on the two columns, that way you get 
uniqueness and not null constraints.

-bill




view thread (4+ messages)  latest in thread

Message-ID: <410E9086.3060204@solutionst.com>
Permalink:  ../410E9086.3060204@solutionst.com/
Also on:    postgresql.org/message-id/410E9086.3060204@solutionst.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: bharper@solutionst.com, jkanter@virginia.edu
  Subject: Re: no dup rows
  In-Reply-To: <410E9086.3060204@solutionst.com>
  References: <410E88D6.8050906@virginia.edu> <410E9086.3060204@solutionst.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox