X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 498A39DC82B for ; Tue, 20 Dec 2005 03:03:37 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18736-04 for ; Tue, 20 Dec 2005 03:03:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id E3CCF9DC85D for ; Tue, 20 Dec 2005 03:03:33 -0400 (AST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.21]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EobX3-0000U9-CH; Tue, 20 Dec 2005 20:03:33 +1300 Message-ID: <43A7ACCC.3020601@opencloud.com> Date: Tue, 20 Dec 2005 07:03:40 +0000 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "j.random.programmer" CC: pgsql-jdbc@postgresql.org Subject: Re: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT References: <20051219234136.59714.qmail@web32012.mail.mud.yahoo.com> In-Reply-To: <20051219234136.59714.qmail@web32012.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.06 required=5 tests=[AWL=0.060] X-Spam-Score: 0.06 X-Spam-Level: X-Archive-Number: 200512/90 X-Sequence-Number: 14421 j.random.programmer wrote: > Anywho, in the JDBC driver, why not convert > java booleans as follows: > > true -> '1' > false -> '0' > > and store that in the BIT column ? That wouldn't help you as the parameter is typed as boolean at the protocol level, as is reflected in your error message -- it is a type issue, not a representation issue. If you really want to do a conversion, make it explicit in your query. > Of course, if someone has the following > in the BIT column > > '1001010' > > then: > a) allow the entire value to be retrieved as a String > (getString...) We do that already. > b) If there are any 1's present, return true > is retrieving it as boolean, false if all 0's. That seems very error-prone. -O