title: Play Anorm causing PSQLException "Unable to find server array type for provided name VARCHAR"
body: <p>I'm trying to insert a List[String] in a postgres text[] (text array) column using the following code:</p>
  
  <pre><code>  def insertList(listName: String, subLists: List[String]): Long = {
      DB.withConnection{implicit c =&gt;
        SQL(
           """
             INSERT INTO mailinglists(name, sublists) VALUES({listName}, {subLists})
           """)
             .on('listName -&gt; listName, 'subLists -&gt; subLists.toArray)
             .executeInsert(scalar[Long] single)
          }
     }
  </code></pre>
  
  <p>This is throwing the runtime exception:</p>
  
  <pre><code>org.postgresql.util.PSQLException: Unable to find server array type for provided name VARCHAR
  </code></pre>
  
  <p>When I search on this exception, most solutions tell the poster to make their typecast "VARCHAR" lowercase <a href="https://stackoverflow.com/questions/7931654/how-create-a-sql-array-from-a-java-list">example</a></p>
  
  <p>Except when using anorm, the code that is doing this is hidden, something like:</p>
  
  <pre><code>ConnectionPool.borrow().createArrayOf("VARCHAR", array));
  </code></pre>
  
  <p>Additionally, I found this in <a href="https://github.com/playframework/anorm/blob/ce5e676ff0317eb3005156bd5717c768b9f8dc40/core/src/main/scala/anorm/ParameterMetaData.scala" rel="nofollow noreferrer">Anorm's ParameterMetaData code</a></p>
  
  <pre><code>implicit object StringParameterMetaData extends ParameterMetaData[String] {
     val sqlType = "VARCHAR"
     val jdbcType = Types.VARCHAR
    }
  </code></pre>
  
  <p>Not sure if it's the cause. Any help is appreciated.</p>