Re: FK v.s unique indexes

Поиск
Список
Период
Сортировка
От Tim Cross
Тема Re: FK v.s unique indexes
Дата
Msg-id 87va9wvugn.fsf@gmail.com
обсуждение исходный текст
Ответ на FK v.s unique indexes  (Rafal Pietrak <rafal@ztk-rp.eu>)
Список pgsql-general
Rafal Pietrak <rafal@ztk-rp.eu> writes:

>
> In particular, contrary to what the ERROR says, the target table *does
> have* a "unique constraint matching given keys", admittedly only
> partial. Yet, why should that matter at all? A unique index, partial or
> not, always yield a single row, and that's all what matters for FK. Right?
>
Is that correct? I would have thought that if you have a multi-key
unique index and you only provide values for some of the keys in the
index, you would have no guarantee of a single row being returned. If
this was true, then the additional keys are superfluous.

Have you tried doing the same thing where the fk keys and remote unique
index keys are equal in number?

-- 
Tim Cross


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: When exactly is a TIMESTAMPTZ converted to the sessions time zone?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: FK v.s unique indexes