Re: trigger is holding up the data - Mailing list pgsql-general

From Stephan Szabo
Subject Re: trigger is holding up the data
Date
Msg-id 20020103100439.G12608-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: trigger is holding up the data  (Nate Haggard <nate@wordplace.com>)
List pgsql-general
On Wed, 2 Jan 2002, Nate Haggard wrote:

> I think I need to clarify.  The trigger is set as AFTER.  The trouble is
> that other tables are changed and the trigger occurs only after the update
> on event and not after the update on all the tables.  If event was the last
> table updated by this program then a trigger AFTER event would be fine.  I
> want the trigger to trigger after updates on the event table but not before
> data is written to all other tables in the database.

The system has no way of understanding "data is written to all other
tables in the database"  in the above without help. Depending on your
schema, you might be able to make a system that would do this (if you know
that there must be rows in <n> other tables, you have some holding table
that you keep track of the write information, and each table has a trigger
that checks that until it sees that all the info is there and does
something), but that depends on your app.

You might also be able to get something like the effect you want from a
deferred trigger.  If you use create constraint trigger and set the
it to initially deferred, the trigger will run at end of transaction.
However, this isn't meant to be something users use and may change or
disappear in the future.



pgsql-general by date:

Previous
From: Chris Albertson
Date:
Subject: Re: Grave performance issues...
Next
From: Chris Albertson
Date:
Subject: Re: Installing postgresql on Win2K