PLPGSQL how to get transaction isolation level info

Поиск
Список
Период
Сортировка
От Janning Vygen
Тема PLPGSQL how to get transaction isolation level info
Дата
Msg-id 200507151732.47910.vygen@gmx.de
обсуждение исходный текст
Ответы Re: PLPGSQL how to get transaction isolation level info  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
i have a function which calculates some aggregates (like a materialized view).
As my aggregation is made with a temp table and 5 SQL Queries, i need a
consistent view of the database. Therefor i need transaction isolation level
SERIALIZABLE, right? Otherwise the second query inside of the function could
read data which differs from the first query (Nonrepeatable Read or Phantom
Read)

ok. so far so good. But know i would like my function to abort if it is not
running inside ransaction isolation level SERIALIZABLE.

How can a function determine in which isolation level it runs?

I looked at the SHOW statement but didn't find anything. i dont wnat to know
the default_transaction_isolation but the current one used.

The reason is mainly for preventing some mistakes inside the caller app. Of
course the app should know what it does and wrap the function call inside a
serializable transaction, but to be sure that my materialized view is
consistent with the rest of the data i would like to enforce it.

Is it possible to get info about the current transaction isolation level?

kind regards,
janning

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

Предыдущее
От: "Andrus"
Дата:
Сообщение: Re: How to create unique constraint on NULL columns
Следующее
От: Hannes Dorbath
Дата:
Сообщение: Re: Looking for a good ERD Tool