Suggestion: Issue warning when calling SET TRANSACTION outside transaction block

Поиск
Список
Период
Сортировка
От Morten Hustveit
Тема Suggestion: Issue warning when calling SET TRANSACTION outside transaction block
Дата
Msg-id CAJajUVQgMC4VQpVY=upnwyearwNqLpBWcWrmeX6vjuf5O2rr=w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block  (Amit Kapila <amit.kapila@huawei.com>)
Список pgsql-hackers
Hi!

Calling "SET TRANSACTION ISOLATION LEVEL ..." outside a transaction
block has no effect.  This is unlike "LOCK ..." and "DECLARE foo
CURSOR FOR ...", which both raise an error.  This is also unlike
MySQL, where such a statement will affect the next transaction
performed.  There's some risk of data corruption, as a user might
assume he's working on a snapshot, while in fact he's not.

I suggest issuing a warning, notice or error message when "SET
TRANSACTION ..." is called outside a transaction block, possibly
directing the user to the "SET SESSION CHARACTERISTICS AS TRANSACTION
..." syntax.

I'm not familiar with the PostgreSQL source code, but it seems this
would have to be added to check_XactIsoLevel() or by calling
RequireTransactionChain() at some appropriate location.



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Performance Improvement by reducing WAL for Update Operation
Следующее
От: Zoltán Böszörményi
Дата:
Сообщение: Re: Strange Windows problem, lock_timeout test request