> > So I am tempted to just
> > hold my nose and hard-code the SQL as JDBC is presumably already
> doing.

JDBC is sending "show transaction_read_only" to find whether it is master
or not.
Victor's patch also started with it, but later it was transformed into
by him as it appeared more appropriate to identify the master / slave.


+ private boolean isMaster(QueryExecutor queryExecutor, Logger logger)
+ throws SQLException, IOException {
+    byte[][] results = SetupQueryRunner.run(queryExecutor, "show
transaction_read_only", true);
+    String value = queryExecutor.getEncoding().decode(results[0]);
+    return value.equalsIgnoreCase("off");

Thanks and Regards
Mithun C Y
EnterpriseDB: http://www.enterprisedb.com

Reply via email to