Does anyone know what Java type maps to a Postgres ltree type?
I create a table like so:
CREATE TABLE foo (text name, path ltree);
This is yet another variant of the strict casting issues in PostgreSQL interacting with client drivers and ORMs that send everything they don't understand as String.
You need to use setObject
with Types.OTHER
, IIRC.
ps.setObject(2, foos.get(i).getName(), Types.OTHER);
which PgJDBC should send as a bind param of type unknown
. Because you're working with PgJDBC directly this is easy for you to deal with, luckily; it's a real pain when people are using ORM layers.
See:
for background.