Hate to reply to my own posts, but I thought the solution I've come
across may help others with problems implementing savepoints and
transactions in functions.
This function implements rollbacks whilst still returning a valid row
instead of an exception. A temporary variable is used to get around
After reading up on Postgres documentation, it seems that transactions
and savepoints are not available to functions, and savepoints are
implemented via BEGIN.. EXCEPTION.. END blocks.
I have a function returning an int4 with the following proposed
structure:
-