X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id DD2BF11F7060 for ; Wed, 19 Apr 2006 12:01:33 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 required=5 tests=[none] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id jqQr+LbW9u-g for ; Wed, 19 Apr 2006 12:01:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id 1F14D11F7040 for ; Wed, 19 Apr 2006 12:01:27 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FWEAv-0002Jx-Oz for pgsql-sql@postgresql.org; Wed, 19 Apr 2006 17:01:01 +0200 Received: from cc503261-a.eelde1.dr.home.nl ([212.204.130.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Apr 2006 17:01:01 +0200 Received: from halfgaar by cc503261-a.eelde1.dr.home.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Apr 2006 17:01:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Wiebe Cazemier Subject: Re: Primary key reference count Date: Wed, 19 Apr 2006 17:00:19 +0200 Lines: 13 Message-ID: References: <20060419130932.GG3828@webserv.wug-glas.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cc503261-a.eelde1.dr.home.nl User-Agent: KNode/0.9.1 X-Archive-Number: 200604/127 X-Sequence-Number: 24936 On Wednesday 19 April 2006 15:33, Wiebe Cazemier wrote: > Either I'm blind, or this is not what I'm looking for. I need to know the > amount of references _to_ a primary key. If you have a customer with two > orders and one invoice, the reference count for the primary key of the > custormer would be 3. > > I need to know if I can delete rows which are not referenced anywhere, > without catching the relational constraint exception. The reason I can't > catch the exception, is that I want the exception to arrive at my application > and/or tests. Never mind. I found another solution.