Received: from ant.utdt ([200.41.62.131]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA50265 for ; Fri, 10 Dec 1999 08:38:59 -0500 (EST) (envelope-from mig@utdt.edu) Received: (from mig@localhost) by ant.utdt (8.8.7/8.8.7) id KAA07281; Fri, 10 Dec 1999 10:35:48 -0300 Date: Fri, 10 Dec 1999 10:35:48 -0300 Message-Id: <199912101335.KAA07281@ant.utdt> X-Authentication-Warning: ant.utdt: mig set sender to Miguel Sofer using -f From: " To: pgsql-sql@postgresql.org Subject: Transactions and functions I have read (in the manual? Can't remember ...) that you cannot BEGIN a transaction in the body of a CREATE FUNCTION (at least for pltcl functions - I seem to remember it has something to do with the SPI interface, so that I assume it is true for any other user defined function). As I want to do some work within such a function, and I do need the transaction to be protected from concurrent access by other users, I am wondering how to do this. Specifically, the question is: does a single SQL statement of the form SELECT myFunction() constitute a transaction, even if it involves multiple SQL statements and SPI calls within the function definition? Assuming the answer to the previous question is 'yes': how can I insure that the transaction isolation level is set to SERIALIZABLE? Do I have to do it from the calling application, or is there a way to let the function itself set the required isolation level? Thanks Miguel Sofer