Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D88F32E3D48 for ; Wed, 19 Dec 2007 11:34:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 31654-06 for ; Wed, 19 Dec 2007 11:34:27 -0400 (AST) Received: from ikoffice.de (ikoffice.de [81.169.166.92]) by postgresql.org (Postfix) with ESMTP id 6126D2E3CAB for ; Wed, 19 Dec 2007 11:34:33 -0400 (AST) Received: from p5481bbf0.dip.t-dialin.net ([84.129.187.240] helo=[192.168.1.16]) by ikoffice.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.66) (envelope-from ) id 1J50wF-0000Xl-IB; Wed, 19 Dec 2007 16:34:28 +0100 Message-ID: <47693B10.3040804@ikoffice.de> Date: Wed, 19 Dec 2007 16:38:56 +0100 From: Daniel Migowski User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org CC: Gregory Stark Subject: Re: TypeInfoCache References: <47692DEB.9070307@ikoffice.de> <877ijan2cp.fsf@oxford.xeocode.com> In-Reply-To: <877ijan2cp.fsf@oxford.xeocode.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Bar: - X-Spam-Score-Int: -17 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/147 X-Sequence-Number: 18002 Gregory Stark schrieb: > "Daniel Migowski" writes: > >> Hello dear developers, >> >> I just updated the TypeInfoCache to return LONGVARCHAR for the PostgreSQL Type >> text. Currently VARCHAR(0) is returned, which seems not correct in my eyes, and >> confuses some major software packets like Chrystal Reports. >> > > Why? 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). 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 >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). With best regards, Daniel Migowski -- |¯¯|¯¯| *IKOffice GmbH Daniel Migowski* | | |/| Mail: dmigowski@ikoffice.de | | // | Nordstr. 10 Tel.: +49 (441) 21 98 89 52 | | \\ | 26135 Oldenburg Fax.: +49 (441) 21 98 89 55 |__|__|\| http://www.ikoffice.de Mob.: +49 (176) 22 31 20 76 Geschäftsführer: Ingo Kuhlmann, Daniel Migowski Amtsgericht Oldenburg, HRB 201467 Steuernummer: 64/211/01864