Re: [SQL] Functions, transactions and RETURN

2005-09-22 Thread Stewart Ben (RBAU/EQS4) *
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

[SQL] Functions, transactions and RETURN

2005-09-22 Thread Stewart Ben (RBAU/EQS4) *
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: -