pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Pradier <david.pradier@clarisys.fr>
To: Daryl Richter <daryl@brandywine.com>
Cc: Russell Simpkins <russellsimpkins@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Design problem : using the same primary keys for inherited objects.
Date: Mon, 17 Oct 2005 15:56:05 +0200
Message-ID: <20051017135605.GD19930@clarisys.fr> (raw)
In-Reply-To: <434FC756.90901@brandywine.com>
References: <20051014091829.GB19930@clarisys.fr>
	<BAY103-DAV1541E0C0650CC9BDA28204B57D0@phx.gbl>
	<20051014124334.GC19930@clarisys.fr>
	<434FC756.90901@brandywine.com>

> >I give a clearer example :
> >CREATE TABLE actor (
> >id_actor serial PRIMARY KEY,
> >arg1 type1,
> >arg2 type2
> >)
> >CREATE TABLE person (
> >id_person INTEGER PRIMARY KEY REFERENCES actor,
> >arg3 type3,
> >arg4 type4
> >)
> >Don't you think it is a BAD design ?
> >If it isn't, well, it will expand my database practices.
> 
> It *is* a bad design.  You should not do this.  After all, how is that 
> any different than this?
> CREATE TABLE actor_person (
>  id_actor serial PRIMARY KEY,
>  arg1 type1,
>  arg2 type2
>  arg3 type3,
>  arg4 type4
>  )
> Furthermore, inheritance is almost certainly the wrong relationship type 
> here.  Normally, Actor would be a Role that a Person would be playing:

Oups, I've made a vocabulary mistake.
By 'actor', I meant "somebody who does something". Lots of tables inherits
from 'actor' in our current design, each of these being a "job" :
laboratory, delivering company, etc...
Furthermore, 'person' inherits from 'actor', and some other tables inherits
from 'person' : user, physician, customer, etc...
Do you continue to think that inheritance is the wrong relationship type
here ?

> It *is* a bad design.  You should not do this.  After all, how is that 
> any different than this?

Well, not every line of actor are in laboratory, as some are in person,
and in some moreother tables. So, it is different, isn't it ?

-- 
David Pradier -- Directeur Technique de Clarisys Informatique -- Chef de projet logiciels libres / open-source



view thread (5+ messages)  latest in thread

Message-ID: <20051017135605.GD19930@clarisys.fr>
Permalink:  ../20051017135605.GD19930@clarisys.fr/
Also on:    postgresql.org/message-id/20051017135605.GD19930@clarisys.fr

 · 

reply

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: david.pradier@clarisys.fr, daryl@brandywine.com, russellsimpkins@hotmail.com
  Subject: Re: Design problem : using the same primary keys for inherited objects.
  In-Reply-To: <20051017135605.GD19930@clarisys.fr>

* 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