imlicit varchar truncation - Mailing list pgsql-jdbc

From Pavel B. Milovantsev
Subject imlicit varchar truncation
Date
Msg-id 1300716597.3957.17.camel@pavhome.intis.tomsk.ru
Whole thread Raw
Responses Re: imlicit varchar truncation  (Sean Bowman <pico303@gmail.com>)
List pgsql-jdbc
Hello.

    I meet the difficulties with insert/update commands using Postgresql
JDBC driver.

    Due to problems described previously at

> Re: value too long for type character varying(25) (http://archives.postgresql.org/pgsql-novice/2002-11/msg00166.php)

 and

>Re: ParameterMetaData getPrecision() always zero? (http://archives.postgresql.org/pgsql-jdbc/2010-01/msg00077.php)

I have to perform an additional call to connection.getMetaData().getColumns()
in order to obtain the size of inserted/updated varchar field, and either
truncate the value at the client side, or make explicit truncations as shown
at (http://www.postgresql.org/docs/9.0/static/datatype-character.html)

The question is, are there any "standard" ways to avoid this excessive
call?
    Have to say that a hand-made DB scheme caching is not the option.

Thank you in advance.
    Pavel Milovantsev.

Attachment

pgsql-jdbc by date:

Previous
From: Vitalii Tymchyshyn
Date:
Subject: Re: domains handling problem
Next
From: Sean Bowman
Date:
Subject: Re: imlicit varchar truncation