Isolation level in a function

Поиск
Список
Период
Сортировка
От bgolda
Тема Isolation level in a function
Дата
Msg-id 1137665141.575201.286460@g14g2000cwa.googlegroups.com
обсуждение исходный текст
Ответы Re: Isolation level in a function  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
Hello, this is my first post, please don't shoot...

I was just experimenting with transactions (PG 8.1), and there is
something which puzzles me. If i write 'SET TRANSACTION ISOLATION LEVEL
SERIALIZABLE;' in my function, it breaks. Error informs me, that it was
executed after some query, while it is a first command in the function
after declares and begin!

However, it seems to work perfectly well if I change in the same place
the system variable, responsible for the transaction level. I used
set_config, if I remember well. The function is only for a DBA task, so
it seems to be all right to use set_config, isn't it?

And my questions are:
1) Why in the first case it is not possible? Is it an error or am I
just doing something wrong? Should have set something before?
2) Are there any downsides of the mentioned solution (changing
transaction_isolation value), except of the fact that it is an
administration command and should not be used :)?

Thanks,

_-_-_-_
Bart Golda


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

Предыдущее
От: "Nik"
Дата:
Сообщение: Connections not closing
Следующее
От: "Peter Zeltins"
Дата:
Сообщение: Using rowtype parameter