Re: check constraint - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: check constraint
Date
Msg-id 20030602130819.GA15591@wolff.to
Whole thread Raw
In response to check constraint  (erwan ancel <erwan.ancel@free.fr>)
Responses Re: check constraint  (erwan ancel <erwan.ancel@free.fr>)
List pgsql-general
On Mon, Jun 02, 2003 at 10:52:00 +0200,
  erwan ancel <erwan.ancel@free.fr> wrote:
> Hi,
> I would like to know if it is possible to set "complex" constraints on
> databases such as:
>
> A->B means that in table A, each record references a record of table B
> (or NULL)
>
> so we have:
>
> A->B
> C->B
> D->C
> D->A
> constraint: for one record of D, D->A->B = D->C->B
>
>     Hope it is clear enough.

It looks like you are talking about foreign keys. Postgres has foreign key
constraints. You can look at the create table documentation to see how
to define them when creating a table.

pgsql-general by date:

Previous
From:
Date:
Subject: Re: URGENT: how to restore corrupted pg?
Next
From: Jeff Eckermann
Date:
Subject: Re: ERROR: CreateTrigger: function.....