Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1689CB5DBB7 for ; Tue, 24 May 2011 08:05:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 14735-02 for ; Tue, 24 May 2011 11:05:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id E472FB5D801 for ; Tue, 24 May 2011 08:05:43 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QOpQl-00028m-Fp for pgsql-jdbc@postgresql.org; Tue, 24 May 2011 04:05:43 -0700 Date: Tue, 24 May 2011 04:05:43 -0700 (PDT) From: aditsu To: pgsql-jdbc@postgresql.org Message-ID: <1306235143484-4421744.post@n5.nabble.com> In-Reply-To: References: <1306228847962-4421529.post@n5.nabble.com> Subject: Re: Why is bool == java.sql.Types.BIT ?? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.864 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FORGED_YAHOO_RCVD=1.63, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201105/73 X-Sequence-Number: 21903 Oliver Jowett wrote: > > Can you explain what (in your application) you would do differently > for a column that returned Types.BOOLEAN versus a column that returned > Types.BIT? > It has to do with analyzing/comparing table structures, copying tables on another server (especially when it uses a different DBMS), and generally handling column types automatically in various situations. If it returns BIT for a boolean column, then I have to add some special handling when using postgres to check for the type name and adjust accordingly. In the particular application where I found the problem, I was doing a "diff" between 2 table structures, and it was generating something like "ALTER TABLE request ADD COLUMN active bit" where "active" was supposed to be boolean. While both types seem to use Boolean on the java side, they are not compatible in postgres. Adrian -- View this message in context: http://postgresql.1045698.n5.nabble.com/Why-is-bool-java-sql-Types-BIT-tp2169629p4421744.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.