code: public static String quoteIdentifier(String identifier, boolean isH2DataBase) {
          if((isH2DataBase && (Constants.H2_RESERVED_WORDS.contains(identifier.toUpperCase())
                          || !H2_SPECIAL_NAME_PATTERN.matcher(identifier).find())) ||
                  (!isH2DataBase && (Constants.POSTGIS_RESERVED_WORDS.contains(identifier.toUpperCase())
                          || !POSTGRE_SPECIAL_NAME_PATTERN.matcher(identifier).find()))) {
              return quoteIdentifier(identifier);
          } else {
              return identifier;
          }
      }
docs: Quote identifier only if necessary. Require database knowledge.
  @param identifier Catalog,Schema,Table or Field name
  @param isH2DataBase True if the quote is for H2, false if for POSTGRE
  @return Quoted Identifier