Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9C7BC1337B6E for ; Fri, 3 Dec 2010 11:58:03 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 30419-09 for ; Fri, 3 Dec 2010 15:57:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 38C331335B36 for ; Fri, 3 Dec 2010 11:57:56 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oB3FvtHM026430; Fri, 3 Dec 2010 10:57:55 -0500 (EST) To: Konstantin Nikiforov cc: pgsql-bugs@postgresql.org Subject: Re: Bug: table inheritance. Trigger before DELETE for each statement is ignored In-reply-to: <20101203111612.3304674e@avers> References: <20101202232343.02f9246c@alkaida> <15326.1291348331@sss.pgh.pa.us> <20101203111612.3304674e@avers> Comments: In-reply-to Konstantin Nikiforov message dated "Fri, 03 Dec 2010 11:16:12 +0300" Date: Fri, 03 Dec 2010 10:57:55 -0500 Message-ID: <26429.1291391875@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/16 X-Sequence-Number: 28822 Konstantin Nikiforov writes: > Also another bug and usecase connected with subj. > It creates parent table "xtest", inherited table "xtest_inh" with > some data, and a trigger BEFORE INSERT/UPDATE/DELETE on table "xtest". > After, it deletes one row. I think you fundamentally misunderstand how triggers on inherited tables work. A row-level trigger is fired for events on rows *in its table*. regards, tom lane