Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5923F2E3787 for ; Fri, 11 Jan 2008 12:01:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 77877-01 for ; Fri, 11 Jan 2008 12:01:30 -0400 (AST) Received: from smtp116.iad.emailsrvr.com (smtp116.iad.emailsrvr.com [207.97.245.116]) by postgresql.org (Postfix) with ESMTP id 218AE2E377F for ; Fri, 11 Jan 2008 12:01:30 -0400 (AST) Received: from relay1.r1.iad.emailsrvr.com (localhost [127.0.0.1]) by relay1.r1.iad.emailsrvr.com (SMTP Server) with ESMTP id 5997944C36F; Fri, 11 Jan 2008 11:01:29 -0500 (EST) Received: by relay1.r1.iad.emailsrvr.com (Authenticated sender: erik-AT-myemma.com) with ESMTP id CE8B344C34E; Fri, 11 Jan 2008 11:01:28 -0500 (EST) In-Reply-To: <478727C3.3090301@archonet.com> 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> <9563.1199992524@sss.pgh.pa.us> <478727C3.3090301@archonet.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Cc: Tom Lane , Alvaro Herrera , Gerardo Herzig , Pavel Stehule , Chris Browne , pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable From: Erik Jones Subject: Re: trigger for TRUNCATE? Date: Fri, 11 Jan 2008 10:01:16 -0600 To: Richard Huxton X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/93 X-Sequence-Number: 29946 On Jan 11, 2008, at 2:24 AM, Richard Huxton wrote: > Tom Lane wrote: >> Alvaro Herrera writes: >>> My thinking is that a TRUNCATE trigger is a per-statement trigger =20= >>> which >>> doesn't have access to the set of deleted rows (Replicator uses =20 >>> it that >>> way -- we replicate the truncate action, and replay it on the =20 >>> 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 =20 >> fire the >> existing ON DELETE-type triggers, but that's not really helpful =20 >> --- you'd >> need a separate trigger-event type. So we could just say by fiat =20 >> that >> an ON TRUNCATE trigger doesn't get any rowset information, even =20 >> after we >> add that for the other types of statement-level triggers. > > I've always considered TRUNCATE to be DDL rather than DML. I =20 > mentally group it with DROP TABLE rather than DELETE> Not that DDL statement triggers wouldn't be just as useful for =20 replication. Erik Jones DBA | Emma=AE erik@myemma.com 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at http://www.myemma.com