pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Migowski <dmigowski@ikoffice.de>
To: pgsql-jdbc@postgresql.org
Cc: Gregory Stark <stark@enterprisedb.com>
Subject: Re: TypeInfoCache
Date: Wed, 19 Dec 2007 16:50:32 +0100
Message-ID: <47693DC8.1010809@ikoffice.de> (raw)
In-Reply-To: <47693B10.3040804@ikoffice.de>
References: <47692DEB.9070307@ikoffice.de>
	<877ijan2cp.fsf@oxford.xeocode.com>
	<47693B10.3040804@ikoffice.de>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Daniel Migowski schrieb:
<blockquote cite="mid:47693B10.3040804@ikoffice.de" type="cite">Gregory
Stark schrieb:
  <br>
  <blockquote type="cite">"Daniel Migowski"
<a class="moz-txt-link-rfc2396E" href="mailto:dmigowski@ikoffice.de">&lt;dmigowski@ikoffice.de&gt;</a> writes:
    <br>
&nbsp;
    <blockquote type="cite">Hello dear developers,
      <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 packets like Chrystal Reports.
      <br>
&nbsp;&nbsp;&nbsp; </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
better matches what i understood what "text" is for. While looking at
the JDBC specification "JSR-000221 JDBC 4.0 Final Release Evaluation",
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 both datatypes (spec page 199, table B-6).
  <br>
  <br>
At all, the driver returns a length of -1 for the "text" type, since
its no varchar type, and software using the metadata might expect to
get something &gt;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 parameter is 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/...;,
Chapter 8.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>
Daniel Migowski<br>
<br>
<div class="moz-signature">-- <br>
<pre> |&macr;&macr;|&macr;&macr;|    <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 89 55
 |__|__|\|  <a href="http://www.ikoffice.de">http://www.ikoffice.de</a;    Mob.: +49 (176) 22 31 20 76
 
            Gesch&auml;ftsf&uuml;hrer: Ingo Kuhlmann, Daniel Migowski
            Amtsgericht Oldenburg, HRB 201467
            Steuernummer: 64/211/01864</pre>
</div>
</body>
</html>



view thread (32+ messages)  latest in thread

Message-ID: <47693DC8.1010809@ikoffice.de>
Permalink:  ../47693DC8.1010809@ikoffice.de/
Also on:    postgresql.org/message-id/47693DC8.1010809@ikoffice.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: dmigowski@ikoffice.de, stark@enterprisedb.com
  Subject: Re: TypeInfoCache
  In-Reply-To: <47693DC8.1010809@ikoffice.de>
  References: <47692DEB.9070307@ikoffice.de> <877ijan2cp.fsf@oxford.xeocode.com> <47693B10.3040804@ikoffice.de> <47693DC8.1010809@ikoffice.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox