Re: Multicolumn foreign keys need useless unique indices?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Antti Haapala <antti(dot)haapala(at)iki(dot)fi>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multicolumn foreign keys need useless unique indices?
Date: 2002-09-14 15:14:23
Message-ID: 26846.1032016463@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)tm(dot)ee> writes:
> If we have unique index on t.i and we define additional unique
> constraint on (t.i, t.j), then we don't need the extra unique index to
> be created - the index on t.i is enough to quarantee the uniqueness of
> (t.i,t.j) or any set of columns that includes t.i.

You missed the point: we are concerned about existence of a row, not only
uniqueness.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-09-14 15:20:26 Re: time default
Previous Message Tom Lane 2002-09-14 14:43:53 Re: DROP TABLE... CASCADE weirdness