Re: Foreign Keys to Non-primary keys?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: zilch(at)home(dot)se
Cc: - <pgsql-general(at)postgresql(dot)org>
Subject: Re: Foreign Keys to Non-primary keys?
Date: 2001-06-21 15:33:49
Message-ID: Pine.BSF.4.21.0106210832560.3593-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, 21 Jun 2001 zilch(at)home(dot)se wrote:

>
> Is it possible to have a foreign key to a non-primary key (also
> meaning non-unique and therefore non-indexed) column i a table?

Generally no. It's not allowed by the spec, so as of 7.1, we
prevent it. Admittedly, you could pull the rug out from underneath
it by dropping the index, though.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thalis A. Kalfigopoulos 2001-06-21 16:10:11 Re: aggregate function for median calculation
Previous Message Tom Lane 2001-06-21 15:19:15 Re: Authentification