>>>>> "andyterry" == andyterry <andrew.terry@xxxxxxxxxxxxxxxx> writes: andyterry> Hi, andyterry> Using a procedure for the first time to run some processing andyterry> for each row in a table, generating output to a target andyterry> table. The following works without COMMIT the example below andyterry> gives: andyterry> INFO: Error Name:cannot commit while a subtransaction is active andyterry> INFO: Error State:2D000 What client are you using to execute this? Some clients may insert SAVEPOINT statements (which create subtransactions) behind your back (e.g. psql with \set ON_ERROR_ROLLBACK does this) in order to recover from errors without aborting the whole transaction. (turn on log_statement=all in your config, or for the user you're executing this as, and look for the command in the server log) -- Andrew (irc:RhodiumToad)