From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-sql@postgresql.org
Subject: Re: Inheritance (general hints wanted)
Date: Tue, 20 Sep 2005 15:09:20 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0509201350240.16480-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0509191721030.14057-100000@matrix.gatewaynet.com>
O Achilleus Mantzios Ýãñáøå óôéò Sep 20, 2005 :
>
> Hi,
>
> I think i have reached a point in my PgSQL years
> that i am seriously thinking of using inheritance.
>
> The situation is simple: An new entity (tanker vessels crew)
> is about to be modeled, and i suspect
> there will be a future need to include
> the rest of 'workers' besides 'sailors',
> IOW i suspect a future need to generalize.
>
> So i am thinking of a two-level tree hierarchy,
> where there is a simple table emp (employee),
> and a direct child 'tankerscrew'. Later
> there may be 'masons', 'office_employees'
> and so on.
Each table may be managed by its own applications,
whereas the accounting software will only need to read
and *update* the generic top level 'employee' table.
That would be great but unfortunately it isnt how
it works in PostgreSQL currently...
If PRIMARY KEYS were to be shared, a great
future (real) feature would be a
"isinstanceof" -like function on the PRIMARY KEY,
which tells if a row of the specific PK is from a certain table
in the hierarchy.
>
> The problem is that while i find this approach
> attractive, i have never used PostgreSQL
> inheritance exhaustively and in production scale.
>
> Furthermore, i also feel that not many
> people have used inheritance in a massive fashion
> (besides playing with a test db).
>
> Of course i can do it with separate uncoupled tables,
> that can be later related with some views.
>
> So that leads to the final question:
> -What are the main PROs of inheritance that cant be beat
> by other solutions, and
> -Are there any traps someone must have in mind when he
> prepares for such a design?
>
> Thanx in advance.
>
--
-Achilleus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: achill@matrix.gatewaynet.com
Subject: Re: Inheritance (general hints wanted)
In-Reply-To: <Pine.LNX.4.44.0509201350240.16480-100000@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox