referencial conlumn contraints and inheritance

From: Stuart <sfbarbee(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: referencial conlumn contraints and inheritance
Date: 2001-04-30 20:16:09
Message-ID: 3AEDC809.471633AE@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Folks,

I am not sure where to post this. This is more of a wishlist item
than a usage question. I am new to postgresql 7.1. Table inheritance
in postgres is wonderfull. Are there any plans to extend support for
inherited tables in column constraints. One example is a travel db where
several tables are defined as:

create table areas (
area_id char(10) primary key,
name varchar(40),
.
description varchar(120) );

create table countries (
.
. ) inherits (areas);

create table states (
.
country_id char(10) references countries ...,
.
. ) inherits (areas);

create table cities (
.
country_id char(10) references countries ...,
.
.) inherits (areas);

Then a destination table set up with a field referencing areas.
Currently postgres does not support reference contraints checking
through inherited tables. Nor does it support subselects in check
constraints. It would be nice to allow reference checking through the
inherited tables so destination.area_id would be valid for any country,
state, or city area_id entered.

create table destination (
.
area_id char(10) references areas ...,
.
.);

Thanks,

Stuart

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-04-30 20:21:00 Re: Problem installing Postgresql
Previous Message Gilles DAROLD 2001-04-30 20:09:09 Re: Problem installing Postgresql