Hello Dmitry,

Thanks for the reply, it seems to be all the columns of type "text". I've tried casting them to varchar but keep getting the same error.

I think it's something in the JDBC Gateway, perhaps in the setup I've got the gateway is very slow if I compare it with an open source client (Squirrel) the query there runs for only 15 seconds, if I execute the same query through the JDBC gateway it takes more then 15 minutes.