Re: Inheritance and referential integritry in 7.0.3 - Mailing list pgsql-general

From Oliver Elphick
Subject Re: Inheritance and referential integritry in 7.0.3
Date
Msg-id 200104080717.f387Hg223026@linda.lfix.co.uk
Whole thread Raw
In response to Inheritance and referential integritry in 7.0.3  ("Alastair D'Silva" <deece@newmillennium.net.au>)
List 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.Elphick@lfix.co.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



pgsql-general by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: reindexing sequences
Next
From: "Oliver Elphick"
Date:
Subject: Re: inheritance and foreign keys