Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly

From: "j(dot)random(dot)programmer" <javadesigner(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly
Date: 2005-12-19 20:14:51
Message-ID: 20051219201451.84589.qmail@web32012.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Running against postgres 8.1

I have:

create table foo (bit_val bit);

If I now try to insert, via the driver's prepared
statement, a value of java boolean true into
the bit_val column, I get:

---------------------------------
ERROR COULD NOT SAVE.....
org.postgresql.util.PSQLException: ERROR: column
"bit_val" is of type bit but expression is of type
boolean
---------------------------------

This is totally wrong if my reading of the JDBC
spec is correct. Java boolean values should
be converted to bitval(1), possibly as '1' and
then converted back to boolean when read from
the database.

If I go to psql directly, the following works fine:

insert into foo (bit_val) values ('1');

THAT is what the driver should to as well.

This is really hokey since it's breaking my
O/R mapping tool.

Best regards,
--j

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2005-12-19 20:55:35 Re: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly
Previous Message j.random.programmer 2005-12-19 18:57:23 8.2dev-500.jdbc3 driver: PreparedStatement.toString() is buggy