Re: Inheritance and referential integritry in 7.0.3

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: "Alastair D'Silva" <deece(at)newmillennium(dot)net(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Inheritance and referential integritry in 7.0.3
Date: 2001-04-08 07:17:42
Message-ID: 200104080717.f387Hg223026@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Alastair D'Silva" wrote:
>I am using PostgreSQL 7.0.3 and have the following schema:
>
>CREATE TABLE "products" (
...
>There are various other tables inheriting from "products".
...
>There is also another table which references products:
...
>Now, if I insert a row into one of "products" child tables (eg, products1),
>then try to reference it in "properties", it does not work as the product id
>is only visible if products* is the target table. Changing the REFERENCES
>target to product* products a syntax error, and creating a view as the
>REFERENCES target is not allowed.
>
>Short of creating another table which stores all product ids, is there a
>simple way to make this work?

No.

I have proposed that this should be allowed, but it is not possible
at the moment.

You can refer directly to a descendant table, of course.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Do not be anxious about anything, but in everything,
by prayer and supplication, with thanksgiving, present
your requests to God. And the peace of God, which
transcends all understanding, will guard your hearts
and your minds in Christ Jesus." Philippians 4:6,7

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2001-04-08 07:23:47 Re: reindexing sequences
Previous Message Eric G. Miller 2001-04-08 07:17:39 Re: Query