Forum OpenACS Development: Response to Global temporary table, trigger procedure

Collapse
Posted by Don Baccus on
You can't specify a trigger on a subset of the columns in PG, so you need to define the trigger on the entire table instead.

If most updates to the table don't alter amount_used and amount_reinstated, it would be more efficient to do something like this:

if new.amount_used = old.amount_used and new.amount_reinstated = old.amount_reinstated then return new;

i.e. only do the update if the columns have actually changed.

As far as the create global temporary table that's done to avoid an Oracle restriction and isn't necessary in PG.  The easiest way to port  this chunk is probably to go to the OpenACS 3.2.5 sources and grab the  previously ported code.