Skip site navigation (1) Skip section navigation (2)

Re: trigger for TRUNCATE?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Chris Browne <cbbrowne(at)acm(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: trigger for TRUNCATE?
Date: 2008-01-10 19:15:24
Message-ID: 9563.1199992524@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
Alvaro Herrera <alvherre(at)commandprompt(dot)com> 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

In response to

Responses

pgsql-sql by date

Next:From: James CloosDate: 2008-01-10 19:48:12
Subject: Escape sequence for UTF-8 Character Literals?
Previous:From: Gerardo HerzigDate: 2008-01-10 18:12:10
Subject: Re: trigger for TRUNCATE?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group