Re: JDBC types vs postgres types correspondation

From: Kris Jurka <books(at)ejurka(dot)com>
To: Marco Solinas <solinas(dot)marco(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC types vs postgres types correspondation
Date: 2008-05-12 07:05:39
Message-ID: Pine.BSO.4.64.0805120302190.15690@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 10 May 2008, Marco Solinas wrote:

> We have a problem with the JDBC types. We need to find out the
> correspondation table between jdbc types and postgresql type.
> What we're trying to do is to build a CREATE TABLE query where a column has
> to be of type "character varying", but we're not able to find the
> corresponding JDBC type.

You are getting hit by a bug in the JDBC driver. The output of
DatabaseMetaData.getTypeInfo is supposed to be sorted by closest match to
DATA_TYPE, but it is not. So you're just getting a random match for a
datatype that can represent text.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message tivvpgsqljdbc 2008-05-12 08:10:31 Re: Correct getScale() behavior?
Previous Message Kris Jurka 2008-05-12 07:02:32 Re: Couple of preparedstatement bug suspects