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