Re: Meta integrity

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Meta integrity
Дата
Msg-id
26279.996211226@sss.pgh.pa.us
Ответ на
Meta integrity (Renato De Giovanni)
Список
Дерево обсуждения
Meta integrity Renato De Giovanni <rdg@viafractal.com.br>
Re: Meta integrity Tom Lane <tgl@sss.pgh.pa.us>
Re: Meta integrity Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: Meta integrity "Josh Berkus" <josh@agliodbs.com>
Re: Meta integrity "Grigoriy G. Vovk" <grigoriy.vovk@linustech.com.cy>
Renato De Giovanni  writes:
>        FOREIGN KEY (object_id, 'X') REFERENCES object (id, class_id)

Why not just store the class_id in the secondary table (if you're
concerned about space, consider using an int4 to represent class_id).
Then you can do a direct two-column foreign key constraint, plus add
a check constraint like CHECK(class_id = 'X').
		regards, tom lane

В списке pgsql-sql по дате отправления
От: Philip Warner
Дата:
От: Philip Warner
Дата:
FAQ