pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Donald Fraser <postgres@kiwi-fraser.net>
To: [ADMIN] <pgsql-admin@postgresql.org>
Subject: Constraint Triggers
Date: Mon, 8 May 2006 09:04:35 +0100
Message-ID: <001201c67276$0bc62440$0264a8c0@demolish1> (raw)

I'm looking for a way to create a trigger function that gets called once per transaction as an AFTER EVENT.
Because there is no option for creating such a trigger function I was looking at the "create constraint trigger" command.

My approach would be to check the current transaction id to ensure that I only execute the function once per transaction and if it was deferred it would happen at the end of the transaction which would simulate an AFTER EVENT.

Apart from the obvious backup and restore problems can anyone think of any undesired side effects if I used this command?

Thanks in advance,
Donald Fraser

view thread (6+ messages)  latest in thread

Message-ID: <001201c67276$0bc62440$0264a8c0@demolish1>
Permalink:  ../001201c67276$0bc62440$0264a8c0@demolish1/
Also on:    postgresql.org/message-id/001201c67276$0bc62440$0264a8c0@demolish1

 · 

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-admin@postgresql.org
  Cc: postgres@kiwi-fraser.net
  Subject: Re: Constraint Triggers
  In-Reply-To: <001201c67276$0bc62440$0264a8c0@demolish1>

* 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