X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BF81E53319 for ; Thu, 5 May 2005 19:30:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76673-03 for ; Thu, 5 May 2005 22:30:47 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id F236C53AAF for ; Thu, 5 May 2005 19:30:45 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DTorn-0005N2-Dg; Fri, 06 May 2005 10:30:47 +1200 Message-ID: <427A9E97.9090307@opencloud.com> Date: Fri, 06 May 2005 10:30:47 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Arthurs Cc: "[pgsql-jdbc]" Subject: Re: Upgrade to pg and driver version 8.x code compatibilities References: <4279EE11.10607@jobflash.com> In-Reply-To: <4279EE11.10607@jobflash.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/30 X-Sequence-Number: 12861 Tom Arthurs wrote: > ERROR: column "job_experience" is of type smallint but expression is of > type character varying Most likely you are using setString() where you should be using setShort(). > 1. What changed between the driver versions that generate this error? The driver started to use server-side prepared statements for parameterization of queries (i.e. the driver translates ? to $n in the main query string, and sends the actual parameter values out-of-band from the query itself). One sideeffect of this is that parameters are more strongly typed than in the 7.4.x versions where the driver would do literal parameter substitution into the query string before sending it to the backend. Also, you can use parameters in fewer places (they must fit the backend's idea of where parameterizable expressions are allowed) -- e.g. see the recent thread about "ORDER BY ?" changing behaviour with the newer driver. > 2. What is the downside of continuing to use the 7.x version of the > driver -- or are there better alternatives (patch, new version, etc). I > am using build 311 of the driver. Most active development happens on the 8.0 version; 7.4.x is maintained for bugfixes but that's about it, you won't get the benefit of any performance improvements or added features that go into 8.0. Also, the 7.4.x driver won't necessarily work with servers >= 8.0. In the longer term, the 7.4.x version will eventually become unmaintained. -O