private static ArrayList<Object> getResultSetColumn(@Nullable ResultSet rs, String columnName) throws SQLException {
    ArrayList<Object> values = new ArrayList<>();
    if (null != rs) {
      while (rs.next()) {
        values.add(rs.getObject(columnName));
      }
    }
    return values;
  }
This makes the following checks for Postgres:
<ol>
  <li>Check if the connection's schema (first item on search path) is the one set in ambari.properties</li>
  <li>Check if the connection's schema is present in the DB</li>
  <li>Check if the ambari tables exist in the schema configured in ambari.properties</li>
  <li>Check if ambari tables don't exist in other shemas</li>
</ol>
The purpose of these checks is to avoid that tables and constraints in ambari's schema get confused with tables
and constraints in other schemas on the DB user's search path. This can happen after an improperly made DB restore
operation and can cause issues during upgrade.
we may have no permissions (e.g. external DB) to auto fix this problem
ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java