Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 6F971633C0A for ; Mon, 14 Sep 2009 14:01:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 43275-01 for ; Mon, 14 Sep 2009 17:01:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 90E6263351A for ; Mon, 14 Sep 2009 14:01:05 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MnEvC-0006GP-Nr for pgsql-sql@postgresql.org; Mon, 14 Sep 2009 19:00:58 +0200 Received: from ppp-82-135-84-10.dynamic.mnet-online.de ([82.135.84.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2009 19:00:58 +0200 Received: from spam_eater by ppp-82-135-84-10.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2009 19:00:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Thomas Kellerer Subject: Re: CHECK constraint on multiple tables Date: Mon, 14 Sep 2009 19:00:37 +0200 Lines: 9 Message-ID: References: <4AAE43F8.4000107@megafon.hr> <15921.1252937895@sss.pgh.pa.us> <4AAE5141.70300@megafon.hr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-82-135-84-10.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <4AAE5141.70300@megafon.hr> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.466 tagged_above=-10 required=5 tests=AWL=0.133, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200909/61 X-Sequence-Number: 33126 Mario Splivalo wrote on 14.09.2009 16:20: >> Have you considered refactoring so there's only one table? > > Unfortunately I can't do that, due to the > object-relational-mapper-wrapper-mambo-jumbo. > You could still refactor that into one single table, then create two updateable views with the names that the dreaded OR mapper expects. That would enable you to have a proper unique check on the base table, and you OR mapper still sees two tables that it can update. Thomas