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 046F95282E for ; Mon, 20 Jun 2005 09:23:44 -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 22460-10 for ; Mon, 20 Jun 2005 12:23:35 +0000 (GMT) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.192]) by svr1.postgresql.org (Postfix) with ESMTP id E783C52814 for ; Mon, 20 Jun 2005 09:23:34 -0300 (ADT) Received: by nproxy.gmail.com with SMTP id g2so33174nfe for ; Mon, 20 Jun 2005 05:23:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rXlPrGfaRnM7vHoZPLjpVvk4laiOsTUaAcrtNTGNFcMRH9y/HZFXNynnh/dmzSWE427vvRmbR+m+B9P/58hQXd0D6WakhCHRlbOm8KhpEzXPqjiAuMZz1NZPr7NGf0L4n0NLeAcc4vRBnE0zK+vEt18zvgRPsviji0N6KbOAvqk= Received: by 10.48.4.10 with SMTP id 10mr81824nfd; Mon, 20 Jun 2005 05:23:37 -0700 (PDT) Received: by 10.48.249.2 with HTTP; Mon, 20 Jun 2005 05:23:37 -0700 (PDT) Message-ID: <224f323405062005231457ebaa@mail.gmail.com> Date: Mon, 20 Jun 2005 14:23:37 +0200 From: Thomas Dudziak Reply-To: Thomas Dudziak To: pgsql-jdbc@postgresql.org Subject: Re: Exception when inserting boolean values into BIT columns In-Reply-To: <42B6B238.5090208@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <224f3234050620030565ffa711@mail.gmail.com> <42B6B238.5090208@opencloud.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.024 tagged_above=0 required=5 tests=RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200506/104 X-Sequence-Number: 13066 On 6/20/05, Oliver Jowett wrote: > As I understand it, JDBC's BIT/BOOLEAN types (single boolean value) > aren't the same as PostgreSQL's BIT type (bit string). The JDBC driver > maps setBoolean(), setObject(...,Types.BIT), and > setObject(...,Types.BOOLEAN) to the 'boolean' datatype. >=20 > Try using the boolean type in your schema, assuming what you want to > store is a single boolean value. If you really want a bitstring, you'll > probably need to do something nasty like pass the value via setString() > and use 'pg_catalog.bit(?)' in your query to do the type conversion > (CAST AS doesn't seem to work from brief testing) Ah, yes, didn't notice that. Yep, I wanted to store a boolean value, so I'll use postgresql's boolean type instead. Thanks for pointing this out to me, Tom