lib/pghero/methods/replica.rb in pghero-1.6.4 vs lib/pghero/methods/replica.rb in pghero-1.6.5
- old
+ new
@@ -1,10 +1,10 @@
module PgHero
module Methods
module Replica
def replica?
unless defined?(@replica)
- @replica = select_all("SELECT setting FROM pg_settings WHERE name = 'hot_standby'").first["setting"] == "on"
+ @replica = PgHero.truthy?(select_all("SELECT pg_is_in_recovery()").first["pg_is_in_recovery"])
end
@replica
end
# http://www.postgresql.org/message-id/CADKbJJWz9M0swPT3oqe8f9+tfD4-F54uE6Xtkh4nERpVsQnjnw@mail.gmail.com