Skip site navigation (1) Skip section navigation (2)

Re: foreign key check

From: David Gardner <david(at)gardnerit(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: foreign key check
Date: 2007-06-19 00:52:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Woops I missed an important bit there. the select statement should look 
SELECT t1.idTwo JOIN t3 ON = WHERE t3.val=${variable}

David Gardner wrote:
> I have two tables t1, and t2 where t2.fid is a foreign key reference 
> to Except in this case only a subset of the values in t1 are 
> valid, the values in t1 that are valid can be found by doing a:
> Is there some way to add this in as a check constraint? I could just 
> write a pl/pgsql function to perform a check before inserting, but I 
> am beginning to suspect that the reason I am running into this is 
> because my schema isn't accurately representing the business logic of 
> the application.

In response to


pgsql-novice by date

Next:From: Tom LaneDate: 2007-06-19 01:39:08
Subject: Re: foreign key check
Previous:From: David GardnerDate: 2007-06-19 00:47:39
Subject: foreign key check

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group