Re: trigger for TRUNCATE?

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: trigger for TRUNCATE?
Date: 2008-01-10 19:53:44
Message-ID: 1199994824.4266.851.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Alvaro Herrera wrote:
> My thinking is that a TRUNCATE trigger is a per-statement trigger which
> doesn't have access to the set of deleted rows.

> In that way it would be different from a per-statement trigger for
> DELETE.

Completely agree.

A truncate trigger should run a different function to a delete trigger.

This is an important feature for trigger-based replication systems. Not
just slony, but bucardo and others too. It's an embarrassing hole in our
high availability capabilities and we really need to fill the gap. We
can't always control whether an application will issue truncates or
not.

Rather spookily that's what I've been working on this afternoon, though
I didn't realise this thread was in progress until now, nor did I
realise there might be possible objections. I do hope the importance of
it is enough to overcome objections.

Yes, it does look fairly straightforward. Should be ready for when 8.4
opens, assuming we agree.

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Browne 2008-01-10 20:37:54 Re: trigger for TRUNCATE?
Previous Message James Cloos 2008-01-10 19:48:12 Escape sequence for UTF-8 Character Literals?