Hot Standby returns ERRCODE_READ_ONLY_SQL_TRANSACTION in most cases
for illegal actions on a standby.
There are two possible but not normally seen cases that give errors,
but don't set the correct sqlstate, which makes it difficult to
diagnose misdirected SQL from more normal SQL problems.
*Patch corrects this. Thanks to Dimitri for the report.
Backpatching to 9.0
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services