pg_locks.transaction field type

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

pg_locks.transaction field type

Joseph Shraibman
I have a method in my rmi server that takes a query and returns an
Object[][].  I had this query:

SELECT (select relname from pg_catalog.pg_class where relfilenode =
relation) as relname, * FROM pg_locks;

After upgrading from 7.4 to 8.0 I was getting this problem:
WARNING: Servlet.service() for servlet jsp threw exception
java.rmi.UnmarshalException: error unmarshalling return; nested
exception is:
         java.lang.ClassNotFoundException: org.postgresql.util.PGobject
(no security manager: RMI class loader disabled)


The problem seems to be the "transaction" field.  It looks like a number
type, but I can't really tell because "\d pg_catalog" doesn't work in psql.

So what's the difference between 7.4.7 and 8.0.3?  Is it that 7.4.7
never returned anything in the transaction field?  Is it a jdbc bug that
is returning the answer as org.postgresql.util.PGobject instead of some
kind of Number?

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Reply | Threaded
Open this post in threaded view
|

Re: [JDBC] pg_locks.transaction field type

Oliver Jowett
Joseph Shraibman wrote:
> Is it a jdbc bug that
> is returning the answer as org.postgresql.util.PGobject instead of some
> kind of Number?

The column's type is 'xid' which the driver doesn't currently handle, so
it gets put into the "wrap it in PGobject" bucket.

I'm not sure what's changed between 7.4 & 8.0 -- did you also change
JDBC driver versions?

Perhaps your server should convert instances of PGobject to their string
representations before returning them across RMI.

-O

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [hidden email] so that your
       message can get through to the mailing list cleanly
Reply | Threaded
Open this post in threaded view
|

Re: [JDBC] pg_locks.transaction field type

Joseph Shraibman


Oliver Jowett wrote:
> Joseph Shraibman wrote:
>
>> Is it a jdbc bug that is returning the answer as
>> org.postgresql.util.PGobject instead of some kind of Number?
>
>
> The column's type is 'xid' which the driver doesn't currently handle, so
> it gets put into the "wrap it in PGobject" bucket.

Is xid a type of number?
>
> I'm not sure what's changed between 7.4 & 8.0 -- did you also change
> JDBC driver versions?

yes
>
> Perhaps your server should convert instances of PGobject to their string
> representations before returning them across RMI.

That's what I'll do.  Are there any other classes besides
org.postgresql.util.PGobject that I have to worry about?

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org
Reply | Threaded
Open this post in threaded view
|

Re: [JDBC] pg_locks.transaction field type

Oliver Jowett
Joseph Shraibman wrote:

>> The column's type is 'xid' which the driver doesn't currently handle,
>> so it gets put into the "wrap it in PGobject" bucket.
>
> Is xid a type of number?

It's an internal backend type; I'm not familiar with the details.

>> Perhaps your server should convert instances of PGobject to their
>> string representations before returning them across RMI.
>
> That's what I'll do.  Are there any other classes besides
> org.postgresql.util.PGobject that I have to worry about?

There are other classes for things like intervals and the geometric
types, but they should all be subclasses of PGobject.

-O

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Reply | Threaded
Open this post in threaded view
|

Re: [JDBC] pg_locks.transaction field type

Alvaro Herrera-4
On Thu, Aug 18, 2005 at 03:55:43PM +1200, Oliver Jowett wrote:
> Joseph Shraibman wrote:
>
> >>The column's type is 'xid' which the driver doesn't currently handle,
> >>so it gets put into the "wrap it in PGobject" bucket.
> >
> >Is xid a type of number?
>
> It's an internal backend type; I'm not familiar with the details.

It's an unsigned 4 byte integer.

--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Cada quien es cada cual y baja las escaleras como quiere" (JMSerrat)

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq
Reply | Threaded
Open this post in threaded view
|

Re: [JDBC] pg_locks.transaction field type

Joseph Shraibman
So basically what needs to be changed is  TypeInfoCache.java & Oid.java

Alvaro Herrera wrote:

> On Thu, Aug 18, 2005 at 03:55:43PM +1200, Oliver Jowett wrote:
>
>>Joseph Shraibman wrote:
>>
>>
>>>>The column's type is 'xid' which the driver doesn't currently handle,
>>>>so it gets put into the "wrap it in PGobject" bucket.
>>>
>>>Is xid a type of number?
>>
>>It's an internal backend type; I'm not familiar with the details.
>
>
> It's an unsigned 4 byte integer.
>

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq