fix primary/standby db detection