"Eric Davies" <slowcanuck 'at' gmail.com> writes:
> java.sql.PreparedStatement st = conn.prepareStatement("insert into
> vectortest(a) values(?::integer[])");
> st.setString(1, "{1,2,3}");
> st.execute();
>
> which threw the exception:
> org.postgresql.util.PSQLException: ERROR: cannot cast type character varying to
> integer[]
You may use string_to_array. In some cases, it's quite handy for
passing SQL arrays to PG (AFAIK in your case you still need to
cast to integer[], but it works).
http://zarb.org/~gc/html/doc-misc.html#2008-08-21
--
Guillaume Cottenceau