Thread: inheritance and foreign key

inheritance and foreign key

From
Estelle_Littee@etu.u-bourgogne.fr
Date:
Hello,

We have the following schema :
create table A (id_A integer primary key,b_A integer);
create table B (a_B integer) inherits A;
create table C (id_C integer primary key, b_C integer);
create table D (id1 integer references A (id_A),
                id2 integer references C (id_C),
                primary key(id1, id2));

Problem occurs when we want to insert a tuple into D
that references a B's tuple. Our idea is :
create table D (id1 integer references A* (id_A),
                id2 integer references C (id_C),
                primary key(id1, id2));
which is not allowed by postgres.

Does anyone has experimented such problem?

Thanks



Re: inheritance and foreign key

From
Stephan Szabo
Date:
Yes, it's currently not implemented (see other currently
running thread in pgsql-general about this topic)

On Fri, 9 Mar 2001 Estelle_Littee@etu.u-bourgogne.fr wrote:

> Hello,
>
> We have the following schema :
> create table A (id_A integer primary key,b_A integer);
> create table B (a_B integer) inherits A;
> create table C (id_C integer primary key, b_C integer);
> create table D (id1 integer references A (id_A),
>                 id2 integer references C (id_C),
>                 primary key(id1, id2));
>
> Problem occurs when we want to insert a tuple into D
> that references a B's tuple. Our idea is :
> create table D (id1 integer references A* (id_A),
>                 id2 integer references C (id_C),
>                 primary key(id1, id2));
> which is not allowed by postgres.
>
> Does anyone has experimented such problem?