Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 90E789FB784 for ; Tue, 26 Jun 2007 17:50:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 80541-02 for ; Tue, 26 Jun 2007 17:50:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0ED809FB892 for ; Tue, 26 Jun 2007 17:50:15 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l5QKoClL028443; Tue, 26 Jun 2007 16:50:13 -0400 (EDT) To: Wiebe Cazemier cc: pgsql-sql@postgresql.org Subject: Re: Delete rules and functions In-reply-to: References: Comments: In-reply-to Wiebe Cazemier message dated "Tue, 26 Jun 2007 21:32:22 +0200" Date: Tue, 26 Jun 2007 16:50:12 -0400 Message-ID: <28442.1182891012@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/229 X-Sequence-Number: 28719 Wiebe Cazemier writes: > I have the following scenerio: > a rule on a view which executes a function by means of a select call, which in > turn deletes from a table which has on-delete rules on it. When the function > is called from the rule, the subsequent delete call in the function doesn't > cause the on-delete rules on the table to be taken into account. Please provide an example, because the rewriter is most certainly applied to queries from functions. I suspect you are actually being burnt by some other effect, like a row disappearing from the view as soon as its underlying data is deleted. regards, tom lane