Allowing DML RULEs that produce Read Only actions during RO xacts

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Allowing DML RULEs that produce Read Only actions during RO xacts
Дата
Msg-id 1260097373.13774.44448.camel@ebony
обсуждение исходный текст
Ответы Re: Allowing DML RULEs that produce Read Only actions during RO xacts
Список pgsql-hackers
I would like to allow RULEs ON INSERT, ON UPDATE and ON DELETE during
read only transactions iff they generate only SELECT statements that act
INSTEAD OF the actual event.

CREATE RULE foorah
  AS ON INSERT TO foo
  DO INSTEAD SELECT remote_insert(NEW.col1, NEW.col2, ...);

The above rule is currently disallowed during READ ONLY transactions,
even though the write action is re-written into a read-only action.

I have a small patch that allows this, attached here with test cases.

This would be a small, but useful additional feature for Hot Standby,
since it would allow INSERT, UPDATE, DELETE statements to be re-routed,
for various applications.

--
 Simon Riggs           www.2ndQuadrant.com

Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Hot standby, recent changes
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Hot standby, recent changes