Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 923B3633AE1 for ; Wed, 3 Mar 2010 12:07:11 -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 32841-03 for ; Wed, 3 Mar 2010 16:07:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sargon.lncsa.com (mail.lncsa.com [213.215.28.11]) by mail.postgresql.org (Postfix) with ESMTP id E679A6336E9 for ; Wed, 3 Mar 2010 12:07:00 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sargon.lncsa.com (Postfix) with ESMTP id 1ADE3301E6D3 for ; Wed, 3 Mar 2010 17:07:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lncsa.com Received: from sargon.lncsa.com ([127.0.0.1]) by localhost (sargon.lncsa.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MPnNb478VdVb for ; Wed, 3 Mar 2010 17:07:00 +0100 (CET) Received: from zenon.apartia.fr (zenon.apartia.fr [10.0.3.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "zenon.apartia.fr", Issuer "ca.apartia.fr" (verified OK)) by sargon.lncsa.com (Postfix) with ESMTP id EE156300E35F for ; Wed, 3 Mar 2010 17:06:59 +0100 (CET) Received: from galba.apartia.fr (galba.apartia.fr [10.0.3.119]) by zenon.apartia.fr (Postfix) with ESMTP id 9CF8058A0DA2E for ; Wed, 3 Mar 2010 17:06:59 +0100 (CET) Received: by galba.apartia.fr (Postfix, from userid 1000) id 8714A1D42C; Wed, 3 Mar 2010 17:06:59 +0100 (CET) Date: Wed, 3 Mar 2010 17:06:59 +0100 From: Louis-David Mitterrand To: "pgsql-sql@postgresql.org" Subject: Re: check constraint on multiple tables? Message-ID: <20100303160659.GA22889@apartia.fr> Mail-Followup-To: "pgsql-sql@postgresql.org" References: <20100303150227.GA18661@apartia.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.437 tagged_above=-10 required=5 tests=AWL=-0.697, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201003/20 X-Sequence-Number: 33727 On Wed, Mar 03, 2010 at 10:03:05AM -0600, Little, Douglas wrote: > Hello, > > I would have designed as ship > cabin (PK of ship_id, Cabin_id) > And a separate chain of cabin_type > cabin_category > cabin Ah, now I'm having second thoughts about my schema ;) > Type, and category are group classifiers and shouldn't be used to > define the uniqueness of a cabin. Yes, but some ships have quite unique cabin types and categories. > Take an example where the cabin category and type are defined globally > for the entire fleet. Currently you'll have to duplicate the type, > category defintions for each ship. Each ship is unique (more or less, a cruise line has several classes of ships). So are its types and cats so it's not so clear cut.