check on foreign table?

From: Esmin Gracic <esmin(dot)gracic(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: check on foreign table?
Date: 2011-01-26 18:11:59
Message-ID: AANLkTi=mAfzt--TAipFjkigFDHFNWkutDsPrcKUfX5R_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message MargaretGillon 2011-01-26 18:12:34 Re: Install Pgadmin3 1.12 on ubuntu 10.4 lucid client without postgresql server install
Previous Message Adrian Klaver 2011-01-26 17:46:42 Re: Install Pgadmin3 1.12 on ubuntu 10.4 lucid client without postgresql server install