Re: check constraint on multiple tables?

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: check constraint on multiple tables?
Date: 2010-03-03 15:57:48
Message-ID: 396486431003030757q115b977lde82c4bf443f4b0d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Mar 3, 2010 at 7:38 AM, Louis-David Mitterrand
<vindex+lists-pgsql-sql(at)apartia(dot)org> wrote:

> Each ship is different and has specific cabin types and categories. Of
> course there is some overlap between ships but I thought it simpler (or
> more elegant) to use that hierarchy. Maybe my schema is wrong?

I'm probably ignorant about ships, but are ships like air planes in
that all ships belong to a similar class/construction? i.e. all
Bowing 747 are essentially configured that same. Can you define ship
classes that each ship belongs? You describe cabin_category as if it
is actually an area of this ship, would all ships of a class have
nearly identical ship_areas/cabin_categories?

> I could add an id_ship to 'cabin' but that would make two (potentialy
> conflicting) relations to 'ship'.

It true that more refinement is necessary. As you've mentioned that
this hierarchy will have overlap, this is an indication of a violation
of the second normal form (I believe).

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Little, Douglas 2010-03-03 16:03:05 Re: check constraint on multiple tables?
Previous Message Louis-David Mitterrand 2010-03-03 15:38:31 Re: check constraint on multiple tables?