Transactions and functions

Поиск
Список
Период
Сортировка
От
Тема Transactions and functions
Дата
Msg-id 199912101335.KAA07281@ant.utdt
обсуждение исходный текст
Ответы having with sub select?  (<kaiq@realtyideas.com>)
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Czarny Marcin
Дата:
Сообщение: Deleting large objects.
Следующее
От: Eric BARROCA
Дата:
Сообщение: INSERT and SELECT