bkrajendra / trader-dss

Automatically exported from code.google.com/p/trader-dss
0 stars 0 forks source link

triggers should operate with a transaction #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When a row is added to table 'quotes' a trigger fires and calls the
functions that update the derived tables.

Those functions should be called within a transaction so that they either
all work or none do

Original issue reported on code.google.com by peter.st...@1ab.ltd.uk on 7 Feb 2010 at 9:54

GoogleCodeExporter commented 9 years ago
This isn't needed. From
[http://www.postgresql.org/docs/8.2/interactive/plpgsql-structure.html The 
PL/pgSQL]
manual

Functions and trigger procedures are always executed within a transaction 
established
by an outer query — they cannot start or commit that transaction, since there 
would
be no context for them to execute in. However, a block containing an EXCEPTION 
clause
effectively forms a subtransaction that can be rolled back without affecting the
outer transaction

Original comment by peter.st...@1ab.ltd.uk on 7 Feb 2010 at 6:46