Re: trigger is holding up the data

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Nate Haggard <nate(at)wordplace(dot)com>
Cc: Gregory Wood <gregw(at)com-stock(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: trigger is holding up the data
Date: 2002-01-03 18:09:10
Message-ID: 20020103100439.G12608-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Albertson 2002-01-03 18:17:53 Re: Installing postgresql on Win2K
Previous Message Chris Albertson 2002-01-03 18:04:35 Re: Grave performance issues...