The answer from Geir Bostad is correct; I answer only to give an example and a possible workaround, as people often do not have enough heads. In addition to the Wiki page referenced by another answer, there is a separate Wiki page for an example that includes the “Deposit Report Example” , seeing the package as closed, but not yet able to see the final part for the batch.
, ; . , , . , , () . WAL , , DEFERRABLE START TRANSACTION; ( - ), , .
, ( , Oracle PostgreSQL 9.1), SELECT , "", , . , , , "" ( ) , , , , , ( , , ) .
, " " write-write. , " " deposit_total , AFTER, deposit_no , AFTER . , , .