constraint with check

From: Viktor Bojović <viktor(dot)bojovic(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: constraint with check
Date: 2010-12-13 23:36:57
Message-ID: AANLkTimx6AsyFJnocPk2-nx1MqUvGbSY3W8JWQmE2dRn@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi
im trying to create foreign key constraint which checks not only the
existence of key in foreign table, but it has to check if node field has
value=true
but i don't know how to do that, so im asking for help.

alter table wg.nc
add CONSTRAINT "nc_fk" FOREIGN KEY ("Id1")
REFERENCES "wg"."entities"("Id"),
check (node=true)

thanx in advance

--
---------------------------------------
Viktor Bojović
---------------------------------------
Wherever I go, Murphy goes with me

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Lee Hachadoorian 2010-12-14 05:11:17 Aggregating by unique values
Previous Message Jasen Betts 2010-12-13 09:18:29 Re: Regular Expression Match Operator escape character