Re: Defining a foreign key with a duplicate column is broken - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Defining a foreign key with a duplicate column is broken
Date
Msg-id 1104.1407555270@sss.pgh.pa.us
Whole thread Raw
In response to Re: Defining a foreign key with a duplicate column is broken  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Defining a foreign key with a duplicate column is broken
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> On Sat, Aug 9, 2014 at 12:13 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> So I'm thinking you're right: we should rewrite this code so that only
>> indexes having all columns distinct can match, thereby ensuring that there
>> is only one possible interpretation of the equality semantics for the
>> foreign key.

> I've attached a patch which disallows these, though I was not quite sure
> about the new error message since likely this is something that should be
> backpacked? I wasn't sure on the policy for new translations in a minor
> release.

There's no need for a new error message I think, because we should just
ignore such indexes.  After all, there might be a valid matching index
later on.
        regards, tom lane



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Defining a foreign key with a duplicate column is broken
Next
From: "Ramirez, Danilo"
Date:
Subject: Re: PostgreSQL vs oracle doing 1 million sqrts am I doing it wrong?