Inheritance

From: Ian Turner <vectro(at)pipeline(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Inheritance
Date: 2000-07-28 14:12:19
Message-ID: Pine.LNX.4.21.0007280706490.828-100000@crafter.house
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is there a way to set it up so that tables B and C are both children of
table A, but where if you add records to B or C, they will show up in A as
well (albiet without the extra fields provided by B and C)?

In case that wasn't thouroughly confusing, allow me to try another
analogy:

CREATE TABLE Entities (num serial PRIMARY KEY);
CREATE TABLE Corporations (name char(40));
CREATE TABLE Players (name char(40),
corp integer REFERENCES Corporations
) INHERITS Entities;

Now, if I insert something into players, like so:
INSERT INTO Players (name) VALUES ('John');

John WILL get a number pulled from the same set as the entity and
corporation tables, but John WILL NOT show up in the entities table. Is
there any way to get new entries in child tables to show up in the parent
table?

Ian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE5gZTFfn9ub9ZE1xoRAmx8AKDglWulL4eo4mvTYosaIGbsv/rj/QCgzd4H
jcD02dIs1JkM4U4uKkg7zr4=
=86pb
-----END PGP SIGNATURE-----

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Lockhart 2000-07-28 14:34:08 Re: ALTER TABLE has not effect on children tables?
Previous Message Louis-David Mitterrand 2000-07-28 13:11:31 ALTER TABLE has not effect on children tables?