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