Re: Defining a foreign key with a duplicate column is broken

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Defining a foreign key with a duplicate column is broken
Дата
Msg-id 16463.1407606567@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Defining a foreign key with a duplicate column is broken  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> On Sat, Aug 9, 2014 at 3:34 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

> hmm, but if the user attempts to define the foreign key that contains a
> duplicate column in the REFERENCES part, then we'll never "find" any
> indexes, so there's no point in looking at all.

OK, now that I'm a bit more awake, I agree with that.

> I've attached a version of the patch that's a little smarter when it comes
> to doing the duplicate checks in the attnums array...

Applied with some cosmetic adjustments.  I didn't bother with the
regression test either --- this doesn't seem like something that needs
permanent memorialization as a regression test.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Reporting the commit LSN at commit time
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: jsonb format is pessimal for toast compression