Re: Foreign key to a view (UNION of two or more tables), any alternative?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jose Gonzalez Gomez <jgonzalez(dot)openinput(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign key to a view (UNION of two or more tables), any alternative?
Date: 2005-06-17 19:49:39
Message-ID: 20050617194939.GA9670@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jun 17, 2005 at 14:35:01 +0200,
Jose Gonzalez Gomez <jgonzalez(dot)openinput(at)gmail(dot)com> wrote:
>
> The problem comes when you have questions that may be not applicable
> (8), or optional (doesn't know, doesn't answer) (9). The easy solution
> would be to have four tables:
>
> yes_no
> yes_no_not_applicable
> yes_no_optional
> yes_no_not_applicable_optional

How about having a table with the valid codes for each question?
This should be relatively easy maintain and you can easily set up
a foreign key reference to this table to enforce integrity.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoffrey 2005-06-17 19:54:28 Re: Making the DB secure
Previous Message Peter Fein 2005-06-17 19:21:57 Error column "sys" does not exist