I'm trying to use a SQL Array type with PostgreSQL 8.4 and the JDBC4 driver.
My column is defined as follows:
nicknames CHARACTER VARYING(255)[] NOT NULL
and I'm trying to update it thusly:
row.updateArray("nicknames",
connection.createArrayOf("CHARACTER VARYING", p.getNicknames().toArray()));
(p.getNicknames()
returns a List<String>
)
but I'm seeing:
org.postgresql.util.PSQLException: Unable to find server array type for provided name CHARACTER VARYING. at org.postgresql.jdbc4.AbstractJdbc4Connection.createArrayOf(AbstractJdbc4Connection.java:67) at org.postgresql.jdbc4.Jdbc4Connection.createArrayOf(Jdbc4Connection.java:21)
Unfortunately, the Array types don't seem to be well documented - I've not found mention of exactly how to do this for PostgreSQL anywhere :(
Any ideas?