Skip site navigation (1) Skip section navigation (2)

Re: BUG #5197: JDBC: selecting oid results in Exception

From: Kris Jurka <books(at)ejurka(dot)com>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5197: JDBC: selecting oid results in Exception
Date: 2009-11-20 23:43:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs

On Thu, 19 Nov 2009, Joseph Shraibman wrote:

> The following bug has been logged online:
> Bug reference:      5197
> Description:        JDBC: selecting oid results in Exception
> Details:
> query: "select oid FROM pg_catalog.pg_class c;"
> -----------------------------------------------
> org.postgresql.util.PSQLException: Bad value for type int : 2148618421
> 	at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.jav
> a:2630)

Java doesn't have an equivalent for unsigned types, so the JDBC driver 
internally tries to fit it into a signed int by using the negative values. 
Unfortunately that's failing and it's not what the user wants for this 
case.  I imagine the user really wants to get a Long back from this.  I'm 
going on vacation next week, but when I return, I'll make that happen.

Kris Jurka

In response to

pgsql-bugs by date

Next:From: Alain BaeckerootDate: 2009-11-20 23:44:55
Subject: BUG #5205: Cannot ADD CONSTRAINT ... FOREIGN KEY...
Previous:From: Heikki LinnakangasDate: 2009-11-20 19:51:39
Subject: Re: BUG #5200: Use of min suffix in autovacuum_naptime ignored

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group