constraint with check - Mailing list pgsql-sql

From Viktor Bojović
Subject constraint with check
Date
Msg-id AANLkTimx6AsyFJnocPk2-nx1MqUvGbSY3W8JWQmE2dRn@mail.gmail.com
Whole thread Raw
List 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

pgsql-sql by date:

Previous
From: Jasen Betts
Date:
Subject: Re: Regular Expression Match Operator escape character
Next
From: Lee Hachadoorian
Date:
Subject: Aggregating by unique values