patch for preventing the specification of conflicting transaction read/write options

Поиск
Список
Период
Сортировка
От Chetan Suttraway
Тема patch for preventing the specification of conflicting transaction read/write options
Дата
Msg-id CAPtHcnEEF2iW4gOdbEy8P-ZOzBxPpFD9pZB14uRUbmZ+KK1ujg@mail.gmail.com
обсуждение исходный текст
Ответы Re: patch for preventing the specification of conflicting transaction read/write options  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
Hi,

This is regarding the TODO item:
"Prevent the specification of conflicting transaction read/write options"

listed at:
http://wiki.postgresql.org/wiki/Todo

The issue is :
SET TRANSACTION read only read write read only;

The fix involved iteration over transaction_mode_list and checking for duplicate entries.
The patch is based on suggestions mentioned in message:
http://archives.postgresql.org/pgsql-hackers/2009-01/msg00692.php

As per this, the patch does not throw any error for the first test case mentioned above.
It throws error only in case of conflicting modes.

For ex:
postgres=# SET TRANSACTION read only read only;
SET

postgres=# SET TRANSACTION read only read write;
ERROR:  conflicting options
LINE 1: SET TRANSACTION read only read write;
                        ^

Below are basic unit test logs:

postgres=# SET TRANSACTION ISOLATION LEVEL serializable ISOLATION LEVEL serializable;
SET
postgres=# SET TRANSACTION ISOLATION LEVEL serializable ISOLATION LEVEL repeatable read;
ERROR:  conflicting options
LINE 1: SET TRANSACTION ISOLATION LEVEL serializable ISOLATION LEVEL...

postgres=# SET TRANSACTION DEFERRABLE DEFERRABLE;
SET
postgres=# SET TRANSACTION DEFERRABLE NOT DEFERRABLE;
ERROR:  conflicting options
LINE 1: SET TRANSACTION DEFERRABLE NOT DEFERRABLE;
                        ^
postgres=# START TRANSACTION read only, read only;
START TRANSACTION
postgres=# rollback;
ROLLBACK
postgres=# START TRANSACTION read only, read write;
ERROR:  conflicting options
LINE 1: START TRANSACTION read only, read write;
postgres=# rollback;
ROLLBACK                          ^
postgres=# BEGIN TRANSACTION ISOLATION LEVEL serializable, ISOLATION LEVEL serializable;
BEGIN
postgres=# rollback;
ROLLBACK
postgres=# BEGIN TRANSACTION ISOLATION LEVEL serializable, ISOLATION LEVEL repeatable read;
ERROR:  conflicting options
LINE 1: BEGIN TRANSACTION ISOLATION LEVEL serializable, ISOLATION LE...
                                          ^

Please pass on any inputs on the patch.

Regards,
Chetan

--
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

EnterpriseDB Blog : http://blogs.enterprisedb.com




Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Command Triggers
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: incorrect handling of the timeout in pg_receivexlog