Re: TypeInfoCache - Mailing list pgsql-jdbc

From Daniel Migowski
Subject Re: TypeInfoCache
Date
Msg-id 47693DC8.1010809@ikoffice.de
Whole thread Raw
In response to Re: TypeInfoCache  (Daniel Migowski <dmigowski@ikoffice.de>)
List pgsql-jdbc
Daniel Migowski schrieb: <blockquote cite="mid:47693B10.3040804@ikoffice.de" type="cite">Gregory Stark schrieb: <br
/><blockquotetype="cite">"Daniel Migowski" <a class="moz-txt-link-rfc2396E"
href="mailto:dmigowski@ikoffice.de"><dmigowski@ikoffice.de></a>writes: <br />   <blockquote type="cite">Hello
deardevelopers, <br /><br /> I just updated the TypeInfoCache to return LONGVARCHAR for the PostgreSQL Type <br />
text.Currently VARCHAR(0) is returned, which seems not correct in my eyes, and <br /> confuses some major software
packetslike Chrystal Reports. <br />     </blockquote><br /> Why? <br /></blockquote> Because VARCHAR (in my
understanding)has some limit, like 256 or 50 or even 8192, whatever. LONGVARCHAR is unlimited as I understand and much
bettermatches what i understood what "text" is for. While looking at the JDBC specification "JSR-000221 JDBC 4.0 Final
ReleaseEvaluation", they didn't make a clear statement on this, but AFAIK varchar always carries a length with it.
"text"does not, so its a LONGVARCHAR. It doesn't matters, because all functions to get the data are equally defined for
bothdatatypes (spec page 199, table B-6). <br /><br /> At all, the driver returns a length of -1 for the "text" type,
sinceits no varchar type, and software using the metadata might expect to get something >0 for the length of a
VARCHAR,like defined in the SQL spec (don't know the page there, but the postgresql handbook says, varchar without a
parameteris a postgres extension). <br /><br /> With best regards, <br /> Daniel Migowski <br /></blockquote> See <a
class="moz-txt-link-freetext"
href="http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html">http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html</a>,
Chapter8.9.7, how others map a very large text type. The biggest they support as varchar is 8.000 chars (MS SQL
Server).Everything over that is LONGVARCHAR (and "text" in postgres is up to 1GB).<br /><br /> With best regards,<br />
DanielMigowski<br /><br /><div class="moz-signature">-- <br /><pre> |¯¯|¯¯|    <b>IKOffice GmbH             Daniel
Migowski</b>| |  |/|                            Mail: <a href="mailto:dmigowski@ikoffice.de">dmigowski@ikoffice.de</a>|
| // |  Nordstr. 10               Tel.: +49 (441) 21 98 89 52|  | \\ |  26135 Oldenburg           Fax.: +49 (441) 21 98
8955|__|__|\|  <a href="http://www.ikoffice.de">http://www.ikoffice.de</a>    Mob.: +49 (176) 22 31 20 76
Geschäftsführer:Ingo Kuhlmann, Daniel Migowski           Amtsgericht Oldenburg, HRB 201467           Steuernummer:
64/211/01864</pre></div>

pgsql-jdbc by date:

Previous
From: Daniel Migowski
Date:
Subject: Re: TypeInfoCache
Next
From: Tom Lane
Date:
Subject: Re: setting PreparedStatement parameter using "at time zone interval ?"