pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndquadrant.com>
To: pgsql-sql@postgresql.org
Subject: Re: trigger for TRUNCATE?
Date: Thu, 10 Jan 2008 19:53:44 +0000
Message-ID: <1199994824.4266.851.camel@ebony.site> (raw)


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




view thread (16+ messages)  latest in thread

Message-ID: <1199994824.4266.851.camel@ebony.site>
Permalink:  ../1199994824.4266.851.camel@ebony.site/
Also on:    postgresql.org/message-id/1199994824.4266.851.camel@ebony.site

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: simon@2ndquadrant.com
  Subject: Re: trigger for TRUNCATE?
  In-Reply-To: <1199994824.4266.851.camel@ebony.site>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox