pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ResultSet.getObject returning PGobject
3+ messages / 3 participants
[nested] [flat]

* ResultSet.getObject returning PGobject
@ 2005-11-18 22:36 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2005-11-18 22:44 ` Re: ResultSet.getObject returning PGobject Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Kevin Grittner @ 2005-11-18 22:36 UTC (permalink / raw)
  To: pgsql-jdbc

PostgreSQL Native Driver
PostgreSQL 8.1 JDBC3 with SSL (build 404)
against 8.1.0

I don't have a reproducible test case, and the messages from the
software are not providing a lot of data, but out of a run with millions
of invocations of ResultSet.getObject, five of those returned an object
of class org.postgresql.util.PGobject.  As far as I can see, this would
have to be a bug in the JDBC driver.  I'm still trying to chase it down,
but I thought I should post here to give everyone a heads up, and
possibly get some suggestions.

-Kevin





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ResultSet.getObject returning PGobject
  2005-11-18 22:36 ResultSet.getObject returning PGobject Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2005-11-18 22:44 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Kris Jurka @ 2005-11-18 22:44 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc



On Fri, 18 Nov 2005, Kevin Grittner wrote:

> I don't have a reproducible test case, and the messages from the
> software are not providing a lot of data, but out of a run with millions
> of invocations of ResultSet.getObject, five of those returned an object
> of class org.postgresql.util.PGobject.  As far as I can see, this would
> have to be a bug in the JDBC driver.  I'm still trying to chase it down,
> but I thought I should post here to give everyone a heads up, and
> possibly get some suggestions.
>

It is expected that the driver will return a PGobject if there underlying 
column data is of a type not directly mappable to a Java type, and if 
there is a pg specific java type configured in the driver.  Traditionally 
we've had additional support for some of the geometric types, but if this 
is something new I would guess it would be the added support in 8.1 for 
the interval datatype.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ResultSet.getObject returning PGobject
@ 2005-11-18 23:50 Kris Jurka <jurka@ejurka.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Kris Jurka @ 2005-11-18 23:50 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc

Kevin Grittner wrote:
> Ah, that may be a good clue.
> 
> We are not selecting any columns which are not directly mappable
> to a Java type -- at least not intentionally.  There is a problem with
> a JDBC escape sequence which is not implemented by PostgreSQL
> which is throwing some exceptions, which we are still cleaning up.
> Perhaps the syntax is occassionally being interpreted in some way
> which is causing this.  I'll suspend this issue until we get the other
> cleaned up and see if we still have this problem.

What escape sequence is that?  We could look at implementing it.

> This is happening on a SELECT where the result set consists entirely
> of simple references to columns from a single table.  The columns are
> all char, varchar, numeric, or int -- so they should all map to Java
> types.  It is happening on a small percentage of SELECTs with no
> apparent difference beyond the values used in otherwise identical
> WHERE clauses.
> 

I see no reason why the WHERE clause would alter the type of a result 
column.  Checking:

Object o = rs.getObject(col);
if (o instanceof PGobject) {
	System.err.println(((PGobject)o).getType());
	System.err.println(((PGobject)o).getValue());
}

or similar would tell you what the returned type was.

Kris Jurka




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-11-18 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-18 22:36 ResultSet.getObject returning PGobject Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-11-18 22:44 ` Kris Jurka <books@ejurka.com>
2005-11-18 23:50 Re: ResultSet.getObject returning PGobject Kris Jurka <jurka@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox