pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: Help with trigger that updates a row prior to a potentially aborted deletion?
Date: Thu, 2 Mar 2006 07:19:43 -0500
Message-ID: <20060302121943.GA7057@phlogiston.dyndns.org> (raw)
In-Reply-To: <20060301204125.3A4B2199B1C@smtp04l.fasthosts.co.uk>
References: <20060301182345.GJ17356@phlogiston.dyndns.org>
	<20060301204125.3A4B2199B1C@smtp04l.fasthosts.co.uk>

On Wed, Mar 01, 2006 at 08:41:20PM -0000, Simon Kinsella wrote:
> Ok thanks, will check this out. Is that the same as savepoints, or something
> different? (am using 8.1.2)

Yes, same thing.

> At the moment I'm investigating using a rule (rewrite the DELETE as an
> UPDATE to set the flag, then use an AFTER UPDATE trigger to attempt to
> delete the row if the flag was set). Not sure if it's going to work but if
> so I'll post back.

In a message you sent that I read after I sent mine, you also said
you had to be able to handle deletes from the table with CASCADE.  My
suggestion won't work for that, I don't think (but it might be worth
a try).  The only other thing I can think of is just flag everything,
and use a daemon to go around and perform the actual deletes for you.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The plural of anecdote is not data.
		--Roger Brinner



view thread (9+ messages)  latest in thread

Message-ID: <20060302121943.GA7057@phlogiston.dyndns.org>
Permalink:  ../20060302121943.GA7057@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20060302121943.GA7057@phlogiston.dyndns.org

 · 

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: ajs@crankycanuck.ca
  Subject: Re: Help with trigger that updates a row prior to a potentially aborted deletion?
  In-Reply-To: <20060302121943.GA7057@phlogiston.dyndns.org>

* 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