Attached patch provides a very simple and easy to use facility for making a read-only server. Set the 'readonly' and optionally 'readonlymsg' configuration flags, and it will block all write activity or changes. This is very useful for adding a read-only standby/replica server.