How to write a constraint which need to check other table? - Mailing list pgsql-general

From 纪晓曦
Subject How to write a constraint which need to check other table?
Date
Msg-id 37a11ce00909280218m53b5da82r9c836844e6ce7975@mail.gmail.com
Whole thread Raw
Responses Re: How to write a constraint which need to check other table?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List pgsql-general
create table a(
         name varchar(32);
);

create talbe b(
          name1 varchar(32);
          name2 varchar(32);
);


How to write a constraint to check name1, name2 in the table a without change table defination?


ALTER TABLE b ADD CHECK(  ??? );


pgsql-general by date:

Previous
From: Johan Nel
Date:
Subject: Re: generic modelling of data models; enforcing constraints dynamically...
Next
From: "A. Kretschmer"
Date:
Subject: Re: How to write a constraint which need to check other table?