Re: Foreign key constraint accepted even when not same

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Foreign key constraint accepted even when not same
Дата
Msg-id 28672.1064277681@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Foreign key constraint accepted even when not same  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: Foreign key constraint accepted even when not same  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-general
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> On Mon, 22 Sep 2003, Jean-Christian Imbeault wrote:
>> Is it right for postgres to accept a foreign key constraint when the
>> type of the field is not the same as that of the foreign key?

> IIRC in SQL92 it's said that they need to be the same type, but in SQL99
> it says that the two types must be comparable.  We basically implement the
> latter, basically using the existance of a usable equality operator as the
> determination of comparable.

Note however that performance may be poor with a cross-type foreign key
reference, if the planner is unable to figure out how to use an index
for the check queries.

            regards, tom lane

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Foreign key constraint accepted even when not same
Следующее
От: Dennis Bjorklund
Дата:
Сообщение: Re: Foreign key constraint accepted even when not same