Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DDB01635001 for ; Tue, 12 May 2009 07:03:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 86527-10 for ; Tue, 12 May 2009 07:03:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from aa002msb.fastweb.it (aa002msb.fastweb.it [85.18.95.81]) by mail.postgresql.org (Postfix) with ESMTP id DC0F9634FD6 for ; Tue, 12 May 2009 07:03:28 -0300 (ADT) Received: from fluca-laptop.localnet (85.18.239.131) by aa002msb.fastweb.it (8.5.016.6) id 4A0192C200F207B8 for pgsql-jdbc@postgresql.org; Tue, 12 May 2009 12:03:26 +0200 From: Luca Ferrari To: pgsql-jdbc@postgresql.org Subject: Re: ResultSet internal data type handling Date: Tue, 12 May 2009 12:03:25 +0200 User-Agent: KMail/1.11.2 (Linux/2.6.28-11-generic; KDE/4.2.2; x86_64; ; ) References: <200905120939.07478.fluca1978@infinito.it> <4A092D2E.3070905@kickstone.com> In-Reply-To: <4A092D2E.3070905@kickstone.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905121203.25544.fluca1978@infinito.it> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/58 X-Sequence-Number: 19608 On Tuesday 12 May 2009 10:02:54 am John Lister's cat walking on the keyboard wrote: > I believe the original wire protocol only supported text values hence > the driver converts all data into a string before sending it to the > server... Because of this the server will generally convert any value > into the appropriate type (if this conversion is possible) which saves > the driver from doing so. This simplifies the driver at the expense of > extra network traffic and errors thrown by the server as opposed to the > driver. The original authors can probably expand on this It is not clear to me: the driver is receiving always strings from the server, and therefore must do the conversion by itself. The fact is that such conversion is not checked against the table definition. I would expect an SQLException if I try to read an integer as a string or viceversa. Instead the conversion can work and the driver says nothing about. Luca