How to write a constraint which need to check other table?

From: 纪晓曦 <sheepjxx(at)gmail(dot)com>
To: Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: How to write a constraint which need to check other table?
Date: 2009-09-28 09:18:48
Message-ID: 37a11ce00909280218m53b5da82r9c836844e6ce7975@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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( ??? );

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2009-09-28 09:46:10 Re: How to write a constraint which need to check other table?
Previous Message Johan Nel 2009-09-28 08:00:17 Re: generic modelling of data models; enforcing constraints dynamically...