>but SELECT pg_is_in_recovery() and SHOW transaction_read_only
>exist in older versions so if we pick either of those methods then it
>will just work.
I am adding next version of the patch it have following fixes.
Tsunakawa's comments
1. PGconn->target_server_type is now freed in freePGconn() 2. Added PGTARGETSERVERTYPE.
Additional comments from others
3. Moved from SELECT pg_is_in_recovery() to SHOW transaction_read_only now should handle different kind of replication, as we recognise server to which writable connection can be made as primary. Very exactly like JDBC driver. Also documented about it.