Distributed keys / Inheritance

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Distributed keys / Inheritance
Date: 2003-12-24 19:23:52
Message-ID: B52AD44C-3646-11D8-97F0-000A95C88220@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here's Tom Lane's response to my original post on pgsql-sql:

> This seems to have considerable overlap with the problem of indexing
> inheritance hierarchies (so that constraints on tables with children
> would work as people expect). It may be that it's sufficient to solve
> it for inheritance cases, and not try to support the generic case of
> constraints applied across arbitrary sets of tables. ISTM that the
> latter could introduce a bunch of extra definitional and practical
> issues beyond what you'd have to solve to do the former.
>
> You're discussing it on the wrong list though --- try -hackers.

Hadn't thought of distributed keys being related to inheritance, though
now I can see how one might apply inheritance to the situations I
mentioned above. Is this what you were thinking, Tom?

Case 1:

employees (id, name)
schools (name, location)

teachers (id, name, school_name)
where (id, name) inherits from employees and school_name references
schools(name)
subs (id, name) inherits from employees
managers (id, name, school_name)
where (id, name) inherits from employees and school_name references
schools(name)

Case 3

comments (comment_id, comment)
employees(id, name)
comments_nonemployees (comment_id, comment, name)
where (id, comment) inherits from comments
comments_employees (comment_id, comment, employee_id)
where (comment_id,comment) inherits from comments, employee_id
references employees(id)

I don't know very much about inheritance in PostgreSQL, so I'm doing a
bit of reading via Google. If anyone has recommendations on good
sources re: inheritance in PostgreSQL, I'd be thankful.

Regards,

Michael Glaesemann
grzm myrealbox com

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2003-12-25 00:28:58 Re: [GENERAL][HACKERS]data fragmentation
Previous Message Michael Glaesemann 2003-12-24 19:02:43 Fwd: [SQL] Distributed keys