Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 38E662E38C5 for ; Thu, 10 Jan 2008 15:15:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 75532-03 for ; Thu, 10 Jan 2008 15:15:19 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0BB362E3889 for ; Thu, 10 Jan 2008 15:15:29 -0400 (AST) 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 m0AJFO3M009564; Thu, 10 Jan 2008 14:15:24 -0500 (EST) To: Alvaro Herrera cc: Gerardo Herzig , Pavel Stehule , Chris Browne , pgsql-sql@postgresql.org Subject: Re: trigger for TRUNCATE? In-reply-to: <20080110174705.GO6465@alvh.no-ip.org> References: <4783BEA9.3020507@fmed.uba.ar> <60tzloyr0u.fsf@dba2.int.libertyrms.com> <162867790801081338n237497efpecffaa255253274d@mail.gmail.com> <47864A6B.3070902@fmed.uba.ar> <20080110171027.GK6465@alvh.no-ip.org> <8003.1199986734@sss.pgh.pa.us> <20080110174705.GO6465@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Thu, 10 Jan 2008 14:47:05 -0300" Date: Thu, 10 Jan 2008 14:15:24 -0500 Message-ID: <9563.1199992524@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/73 X-Sequence-Number: 29926 Alvaro Herrera writes: > My thinking is that a TRUNCATE trigger is a per-statement trigger which > doesn't have access to the set of deleted rows (Replicator uses it that > way -- we replicate the truncate action, and replay it on the replica). > In that way it would be different from a per-statement trigger for > DELETE. Ah, right. I was thinking in terms of having TRUNCATE actually fire the existing ON DELETE-type triggers, but that's not really helpful --- you'd need a separate trigger-event type. So we could just say by fiat that an ON TRUNCATE trigger doesn't get any rowset information, even after we add that for the other types of statement-level triggers. Never mind ... regards, tom lane