REFERENCES

From: Örn Hansen <orn(dot)hansen(at)swipnet(dot)se>
To: pgsql-general(at)postgresql(dot)org
Subject: REFERENCES
Date: 2004-09-16 10:32:27
Message-ID: 200409161232.35032.orn.hansen@swipnet.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I got the following scenario in a database.

CREATE TABLE persons (
id char(15),
name varchar(80)
);

CREATE TABLE customer(
discount int4
) INHERITS (persons);

CREATE TABLE personal_data(
id REFERENCES persons(id) MATCH FULL ON UPDATE CASCADE ON DELETE CASCADE,
class char(20),
info varchar(40)
);

Point of it is, I want to be able to add a mobile phone number as:

INSERT INTO personal_data(id,class,info) values(ID,'MOBILE',PHONENO);

Yet still have it automatically update or deleted if the person disappears in
the database, and not stick around as a ghost.

This works ok, except that the table customer will break it. I can't add
personal_data to a customer, even though all customer fields and data,
including the ID is in the persons database.

So my question is, is there a way to do this now, will this be possible in the
future or what is the status?

Mvh,
Örn

Browse pgsql-general by date

  From Date Subject
Next Message Najib Abi Fadel 2004-09-16 10:35:38 Re: pg_dump in cycle
Previous Message Najib Abi Fadel 2004-09-16 10:08:23 Re: pg_dump in cycle