check on foreign table?

Поиск
Список
Период
Сортировка
От Esmin Gracic
Тема check on foreign table?
Дата
Msg-id AANLkTi=mAfzt--TAipFjkigFDHFNWkutDsPrcKUfX5R_@mail.gmail.com
обсуждение исходный текст
Ответы Re: check on foreign table?
Список pgsql-general
I'm migrating mssql database to pgsql, and have a bunch of small simple ref. tables.

I want to put all ref tables into one table. (denormalize kinda...)

MegaRefTable:
id | value | refType

variant a)
id is primary key and foreign keys from main tables references to id. ids are resequnced in the process.
Is it possible to add check option to foreign key to look at refType type column for particular value.

variant b)
id and refType are primary key. id values are kept. but underlaying tables must have additional column with constant value in odred to satisty composite foreign key?

variant c)
any other ideas? I'm still in learning process of pg, so I might be overlooking some simpler solution...

thanks.
Esmin Gracić
NGO Flores, Sjenica, Serbia

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Install Pgadmin3 1.12 on ubuntu 10.4 lucid client without postgresql server install
Следующее
От: MargaretGillon@chromalloy.com
Дата:
Сообщение: Re: Install Pgadmin3 1.12 on ubuntu 10.4 lucid client without postgresql server install