X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DED7AD1B189 for ; Thu, 27 May 2004 04:08:03 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 36213-07 for ; Thu, 27 May 2004 04:07:45 -0300 (ADT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id DD528D1B215 for ; Thu, 27 May 2004 04:07:41 -0300 (ADT) Received: (qmail 15180 invoked by uid 65534); 27 May 2004 07:07:42 -0000 Received: from p508BDE4E.dip.t-dialin.net (EHLO [192.168.0.108]) (80.139.222.78) by mail.gmx.net (mp001) with SMTP; 27 May 2004 09:07:42 +0200 X-Authenticated: #14269776 Message-ID: <40B593BA.6090502@gmx.net> Date: Thu, 27 May 2004 09:07:38 +0200 From: Andreas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7) Gecko/20040514 X-Accept-Language: de-de, en-us, en MIME-Version: 1.0 To: Jean-Luc Lachance Cc: pgsql-sql@postgresql.org Subject: Re: Multitable uniqueness ? References: <40B40B4A.4050908@gmx.net> <40B4A2FD.8030004@sympatico.ca> In-Reply-To: <40B4A2FD.8030004@sympatico.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/214 X-Sequence-Number: 17928 Jean-Luc Lachance schrieb: > Do you really need MANY-TO-MANY between customers and projects? > I can see customers owning many projects, but do you really have > projects belonging to many customers? In this case yes. projects ( 1, 'x-fair 2003'; 2, 'y-fair 2003'; 3, 'x-fair 2004') customer ( 1, 'X ltd'; 2, 'Y'; 3, 'Z') maybe all 3 have a stall on project 1. c1 and c2 attend project 2 where c2 has 2 stalls one inside and one outside the hall. I have the cust_project relation to tie other objects like proposals and letters to something small and common for all the communication to a customer. > If not, fold cust_proj into projects. > Otherwise, UNIQUE (cp_id, stall_no) on stalls should be enough. cp_id implies uniquness of (customer, project) couples. So with UNIQUE (cp_id, stall_no) we get --> UNIQUE (c_id, p_id, stall_no) This'd be too much. Stall_no is the number of the cubicles the customers rent. It needs to be unique within on project so that we can relate on a specific spot on the area to send visitors when they ask us and we print those numbers in the flyer.