check on foreign table? - Mailing list pgsql-general

From Esmin Gracic
Subject check on foreign table?
Date
Msg-id AANLkTi=mAfzt--TAipFjkigFDHFNWkutDsPrcKUfX5R_@mail.gmail.com
Whole thread Raw
Responses Re: check on foreign table?  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List 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 by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Install Pgadmin3 1.12 on ubuntu 10.4 lucid client without postgresql server install
Next
From: MargaretGillon@chromalloy.com
Date:
Subject: Re: Install Pgadmin3 1.12 on ubuntu 10.4 lucid client without postgresql server install