title: PSQLException: ERROR: operator does not exist: bigint = text[]
body: <p>Looking resolution in postgres DB and MySQL DB working fine</p>
  
  <p>I/P: String ordIds = "343,21,343";</p>
  
  <p>Map fetchDataSource(String orgIds){</p>
  
  <pre><code>    ResultSet resultSet = null;
      PreparedStatement statement = null;
      String str[] = orgIds.split(",");
      List&lt;Integer&gt; orgIdList = new ArrayList&lt;Integer&gt;();
  
      Map&lt;String, String&gt; dataSourceMap = new LinkedHashMap&lt;String, String&gt;();
      orgIdList = Arrays.asList(str).stream().map(Integer::valueOf).collect(Collectors.toList());
      String query = "select ds.ds_path,string_agg(org.organization_id::text, ',') as org_id from c_organization org join org_ds_detail ds on org.org_ds_detail_id = ds.org_ds_detail_id where org.organization_id in (?) GROUP BY ds.ds_path";
      //String queryIN = orgIdList.stream().map(orgId -&gt; String.valueOf(orgId)).collect(Collectors.joining(",", "(", ")"));
  
      try {
          Connection connection = DBConnection.getInstance("CLINICS_GLOBAL");
          statement = connection.prepareStatement(query);
          **Array orgIdsInArray = connection.createArrayOf("text",orgIdList.toArray());
          statement.setArray(1, orgIdsInArray);**
          logger.info("Executing Query:" + query);
          resultSet = statement.executeQuery();
          while (resultSet.next()) {
              dataSourceMap.put(resultSet.getString(1), resultSet.getString(2));
          }
  
      } catch (SQLException e) {
          logger.info("Exception:" + e);
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      } finally {
          try {
              statement.close();
              resultSet.close();
              DBConnection.closeConnection();
          } catch (SQLException e) {
              logger.info("Exception while closing connection:" + e.getMessage());
              e.printStackTrace();
          }
      }
      return dataSourceMap;
  }
  </code></pre>
  
  <p>Exception (Logs):</p>
  
  <pre class="lang-none prettyprint-override"><code>13:16:16,217 INFO  [DataSourceConnection] (default task-2) Exception:org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint = text[]
    Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
    Position: 190
  13:16:16,219 ERROR [stderr] (default task-2) org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint = text[]
  13:16:16,219 ERROR [stderr] (default task-2)   Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  13:16:16,220 ERROR [stderr] (default task-2)   Position: 190
  13:16:16,221 ERROR [stderr] (default task-2)    at 
  </code></pre>