Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DDD8E634241 for ; Wed, 3 Mar 2010 11:58:03 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30417-02-6 for ; Wed, 3 Mar 2010 15:57:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gw0-f46.google.com (mail-gw0-f46.google.com [74.125.83.46]) by mail.postgresql.org (Postfix) with ESMTP id EBA52633CE3 for ; Wed, 3 Mar 2010 11:57:49 -0400 (AST) Received: by gwb15 with SMTP id 15so744014gwb.19 for ; Wed, 03 Mar 2010 07:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GTqGRHNFIXzGgqUuKwzH4cqtYiEJvW+a8GT3hMWKszE=; b=wx1xRC45kiQ5O161heB13z9Mu81lo0VP57AW8Hz61N8tYpWjZ4v2UxiZQeErTzhRLQ u+Qu23m1JPAr82d36zlJ5v2HzsTYADgYwBkYE8MPG25Sye4d0ymJcqRYyZRsnS4i5WId M9ByZ3WBD7fJq4NcZZ3oxXB/R9uti12JcEUKU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Q6mY1NJU4GjPJJgPZMYrgklTfL/Rvfgbqw6/Ih5YnXpLGEkduRDl1XmHV1PXQaLPXs hvpRrTK338etN1+q4RmaAVnTxJgkVytYazywq5XLNLietq+sthzJqpaAKos7DUXqXOzc kSqYLa1RRrxUhM/394h6wHSV6z4R16TT8l6ug= MIME-Version: 1.0 Received: by 10.101.133.38 with SMTP id k38mr2500436ann.219.1267631868055; Wed, 03 Mar 2010 07:57:48 -0800 (PST) In-Reply-To: <20100303153831.GA20503@apartia.fr> References: <20100303150227.GA18661@apartia.fr> <396486431003030714s48b239e2ub8b58a49b9aa29e4@mail.gmail.com> <20100303151900.GA19735@apartia.fr> <396486431003030729x17f921bcr7ff439113a5644ab@mail.gmail.com> <20100303153831.GA20503@apartia.fr> Date: Wed, 3 Mar 2010 07:57:48 -0800 Message-ID: <396486431003030757q115b977lde82c4bf443f4b0d@mail.gmail.com> Subject: Re: check constraint on multiple tables? From: Richard Broersma To: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.057 tagged_above=-10 required=5 tests=AWL=-1.058, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201003/17 X-Sequence-Number: 33724 On Wed, Mar 3, 2010 at 7:38 AM, Louis-David Mitterrand 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