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 88818D1B1D1 for ; Thu, 27 May 2004 04:23:18 -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 47513-01 for ; Thu, 27 May 2004 04:22:59 -0300 (ADT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id C7B53D1B238 for ; Thu, 27 May 2004 04:22:56 -0300 (ADT) Received: (qmail 23080 invoked by uid 65534); 27 May 2004 07:22:57 -0000 Received: from p508BDE4E.dip.t-dialin.net (EHLO [192.168.0.108]) (80.139.222.78) by mail.gmx.net (mp004) with SMTP; 27 May 2004 09:22:57 +0200 X-Authenticated: #14269776 Message-ID: <40B5974D.9000008@gmx.net> Date: Thu, 27 May 2004 09:22:53 +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: Bruno Wolff III Cc: pgsql-sql@postgresql.org Subject: Re: Multitable uniqueness ? References: <40B40B4A.4050908@gmx.net> <20040526122013.GA472@wolff.to> In-Reply-To: <20040526122013.GA472@wolff.to> 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/215 X-Sequence-Number: 17929 Bruno Wolff III wrote: >On Wed, May 26, 2004 at 05:13:14 +0200, > Andreas wrote: > > >>Is there a way to have something like this : UNIQUE (table_1.id, >>table_2.xxx) >> >> > >Postgres doesn't support database constraints at this time which is >what you would need to do this simply. > > Well, a simple way was to have a table_1-foreign key in the table 2. I just thought since there is: table_1 <--1:n-- table_x <--1:n-- table_2 and I hoped not having to add table_1 <--1:n-- table_2 just to have uniquness of an attribute of table_2 and the key of table_1 >You can enforce this constraint by creating a third table > That is more efford than to stuff the column into table_2. Thanks anyway ;)