Re: reading an oidvector field error

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Takeichi Kanzaki Cabrera <tkanzakic(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: reading an oidvector field error
Date: 2006-01-16 21:05:42
Message-ID: 43CC0AA6.605@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Takeichi Kanzaki Cabrera wrote:
> Here is the exception and the stack trace that I get:
> org.postgresql.util.PSQLException: Method
> org.postgresql.jdbc3.Jdbc3Array.getArrayImpl(long,int,Map) is not yet
> implemented.
> at org.postgresql.Driver.notImplemented(Driver.java:580)
> at org.postgresql.jdbc2.AbstractJdbc2Array.getArrayImpl(AbstractJdbc2Array.java:232)
> at org.postgresql.jdbc2.AbstractJdbc2Array.getResultSetImpl(AbstractJdbc2Array.java:291)
> at org.postgresql.jdbc2.AbstractJdbc2Array.getResultSet(AbstractJdbc2Array.java:252)
> at pgObjects.PgDatabase.loadFunctionsFromDatabase(PgDatabase.java:893)

This stacktrace doesn't match the line in your code you claim throws an
exception. You originally said:

> Array argsList = rsFunc.getArray("field");
> ResultSet rsArgs = argsList.getResultSet();
> while (rsArgs.next()) {
> String s = rsArgs.getInt(2); //get an error here.
> PgDataType type = this.getDataType(s);
> args.add(type);
> }

but the code path your stacktrace shows is throwing an exception on
getResultSet().

Can you clarify what the code that actually causes the error is?

However the most likely cause is that the array code just does not
understand the OID type -- there is this code in getArrayImpl when an
unsupported array element type is encountered:

>> default:
>> if (conn.getLogger().logDebug())
>> conn.getLogger().debug("getArrayImpl(long,int,Map) with "+getBaseTypeName());
>> throw org.postgresql.Driver.notImplemented(this.getClass(), "getArrayImpl(long,int,Map)");

(this should really throw a more informative exception..)

You could use getString() and parse the array representation yourself as
a workaround, or teach the driver's array code about oids.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2006-01-16 21:14:18 Re: reading an oidvector field error
Previous Message Takeichi Kanzaki Cabrera 2006-01-16 18:06:09 Re: reading an oidvector field error