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 264F3533FC for ; Tue, 12 Apr 2005 14:05:40 -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 68484-01 for ; Tue, 12 Apr 2005 17:05:32 +0000 (GMT) Received: from mail.weycogroup.com (unknown [66.162.233.194]) by svr1.postgresql.org (Postfix) with ESMTP id 6B1F7533F3 for ; Tue, 12 Apr 2005 14:05:31 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.weycogroup.com (Postfix) with ESMTP id 85E9A5255D for ; Tue, 12 Apr 2005 11:56:00 -0500 (CDT) Subject: Re: smallint vs. boolean (was invalid string enlargement From: Glenn Holmer To: pgsql-jdbc@postgresql.org In-Reply-To: <4239EA95.4020101@opencloud.com> References: <42389DFC.5090408@weycogroup.com> <4238A223.4030003@opencloud.com> <4239B075.7020305@weycogroup.com> <4239EA95.4020101@opencloud.com> Content-Type: text/plain Organization: Weyco Group, Inc. Date: Tue, 12 Apr 2005 12:05:30 -0500 Message-Id: <1113325530.26370.50.camel@shadow.weycogroup.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200504/72 X-Sequence-Number: 12679 On Fri, 2005-03-18 at 09:37 +1300, Oliver Jowett wrote: > Glenn Holmer wrote: > > > We can't upgrade the driver because we get this: > > > > 2005-03-17 10:10:22,961 WARN > > net.sf.hibernate.util.JDBCExceptionReporter - Meth > > od: logExceptions - Line: 38 Message: SQL Error: 0, SQLState: 42883 > > 2005-03-17 10:10:22,962 ERROR > > net.sf.hibernate.util.JDBCExceptionReporter - Meth > > od: logExceptions - Line: 46 Message: ERROR: operator does not exist: > > smallint = boolean > > Without more details I'd have to say this is a hibernate or schema > mapping bug -- it looks like it is using setBoolean() where you should > be using setShort() (or vice versa). This only shows up in newer drivers > because they more tightly bind types to parameters (due to using the V3 > extended query protocol to pass parameters to the server) > > This behaviour is unlikely to change, so you might want to look at > tracking down the cause. As a last resort, you might be able to create > implicit casts between smallint<->boolean. Yes, the database has some fields defined as smallint and set to 0 for false or either 1 for true; the Hibernate DTOs have these fields declared as boolean. Is there any way around this without rewriting everything? -- ____________________________________________________________ Glenn Holmer gholmer@weycogroup.com Software Engineer phone: 414-908-1809 Weyco Group, Inc. fax: 414-908-1601