postgresql jdbc, pgobject available types, array type
<p>I use postgresql 9.5 with jdbc driver 9.4.1208.jre7 and scalikejdbc wrapper</p>

<p>My table is:</p>

<pre><code>CREATE TABLE refs
(
  name character varying NOT NULL,
  custom json,
  prices integer[]
)
</code></pre>

<p>I can insert json values using org.postgresql.util.PGobject:</p>

<pre><code>val res = new PGobject()
res.setType("json")
res.setValue("{'name': 'test'}")
res
</code></pre>

<p>I also want to insert arrays. How can i do this? I thought that this would work:</p>

<pre><code>  def toArrStr(a: Iterable[String]): PGobject = {
    val res = new PGobject()
    res.setType("ARRAY")
    res.setValue(s"{${a.map(i =&gt; '"' + i + '"').mkString(",")}}")
    res
  }
</code></pre>

<p>But it gives me exception: <code>org.postgresql.util.PSQLException: Unknown type ARRAY</code></p>

<p>May be i'm missing smth but i can't find good docs about PGObject class. I think that PGObject class was designed exactly for purposes like mine but it doesn't behaves as expected</p>

<p>POSTGRES has many types, not only array but date, datetime, daterange, timestamprange, so on. I believe that there should be type names for its corresponding types.</p>