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

Re: [HACKERS] JDBC pg_description update needed for CVS tip

From: Barry Lind <barry(at)xythos(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [HACKERS] JDBC pg_description update needed for CVS tip
Date: 2001-09-07 05:22:17
Message-ID: 3B985989.9030209@xythos.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbcpgsql-patches
I believe this was done a while ago.  (It looks like it was patched on 
Aug 17 by a patch from Rene).

thanks,
--Barry

Bruce Momjian wrote:
> Can someone tackles this and supply a patch?
> 
> 
> 
>>Would some JDBC hacker develop a patch for the following issue?  The
>>change is just barely large enough that I don't want to commit untested
>>code for it --- but not having a Java development environment at hand,
>>I can't test the updated code.
>>
>>The problem is in DatabaseMetaData.java (same code in both jdbc1 and
>>jdbc2, looks like).  It does direct access to pg_description that isn't
>>right anymore.  In getTables, instead of
>>
>>	java.sql.ResultSet dr = connection.ExecSQL("select description from pg_description where objoid="+r.getInt(2));
>>
>>it should be
>>
>>	java.sql.ResultSet dr = connection.ExecSQL("select obj_description("+r.getInt(2)+",'pg_class')");
>>
>>In getColumns, the change is a little more involved, because
>>pg_attribute doesn't have an OID column anymore.  The initial query
>>can't fetch a.oid, but should fetch a.attrelid instead, and then the
>>pg_description query should become
>>
>>	java.sql.ResultSet dr = connection.ExecSQL("select col_description("+r.getInt(1)+","+r.getInt(5)+")");
>>
>>(col_description takes the table OID and the column's attnum).
>>
>>The reason this is more than a 3-line change is that it should be done
>>either the old way or the new way depending on whether server version >=
>>7.2 or not, for backwards-compatibility of the driver.
>>
>>It's possible there are other similar changes needed that I missed in a
>>quick lookover.
>>
>>So, would some enterprising person fix the JDBC code to work with CVS
>>tip, and submit a patch?
>>
>>		thanks, tom lane
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 4: Don't 'kill -9' the postmaster
>>
>>
> 



In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-09-07 05:34:46
Subject: Re: [HACKERS] JDBC pg_description update needed for CVS tip
Previous:From: Tom LaneDate: 2001-09-07 04:58:43
Subject: Re: Beta Monday?

pgsql-patches by date

Next:From: Barry LindDate: 2001-09-07 05:24:30
Subject: Re: Read transactions don't work on 7.0.x db's 3rd attempt
Previous:From: Barry LindDate: 2001-09-07 05:06:28
Subject: Re: JDBC patch procedures (Re: [PATCHES] Patch for jdbc2 ResultSet.java)

pgsql-jdbc by date

Next:From: Barry LindDate: 2001-09-07 05:24:30
Subject: Re: Read transactions don't work on 7.0.x db's 3rd attempt
Previous:From: Barry LindDate: 2001-09-07 05:06:28
Subject: Re: JDBC patch procedures (Re: [PATCHES] Patch for jdbc2 ResultSet.java)

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