I am working on a rails app using postgresql 9.1 as a database.in postgresql i a have configured for streaming replication, Now how to add Master and Slave PostgreSQL database in rails application ( in database.yml file) I have specified the database details as
development:
adapter: postgresql encoding: unicorn database: app_development pool: 5 username: username password: password host: master ip port: port number
development:
adapter: postgresql encoding: unicorn database: app_development pool: 5 username: username password: password host: slave ip port: port number
development:
adapter: postgresql encoding: unicorn database: app_development pool: 5 username: username password: password host: svale ip port: port number
But While executing this produces error as " ActiveRecord::StatementInvalid" " PG::ReadOnlySqlTransaction: ERROR: cannot execute INSERT in a read-only transaction"
How to specify the master and slave database in database.yml file
Regards, Balu