| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера