Re: Foreign Keys With Arrays

Поиск
Список
Период
Сортировка
От Andreas Seltenreich
Тема Re: Foreign Keys With Arrays
Дата
Msg-id 87irrr8u9n.fsf@gate450.dyndns.org
обсуждение исходный текст
Ответ на Re: Foreign Keys With Arrays  (Andreas Seltenreich <andreas+pg@gate450.dyndns.org>)
Список pgsql-novice
Andreas Seltenreich writes:

> Ketema Harris writes:
>
>> If I have a column that is of type int4[] (array of integers) is it possible
>> to require that each integer within that array is a foreign key?
>
> I'm afraid you'll have to define a custom check-constraint to do that.
>
> E.g.
>
[...]
> scratch=# create function valid_array(a int4[]) returns boolean as $$
[...]

...and of course you'll need the appropriate trigger function on the
referenced table to maintain referential integrity, but I hope the
example will get you going.

regards,
Andreas
--

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

Предыдущее
От: Andreas Seltenreich
Дата:
Сообщение: Re: Foreign Keys With Arrays
Следующее
От: Srinivas Iyyer
Дата:
Сообщение: Please comment on pgsql speed at handling 550,000 records