Lists: | pgsql-jdbcpgsql-patches |
---|
From: | Jeroen van Vianen <jeroen(dot)van(dot)vianen(at)satama(dot)com> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org |
Subject: | Fix for broken JDBC's getColumn() (take 2) |
Date: | 2001-09-10 18:00:39 |
Message-ID: | 5.1.0.14.2.20010910194701.00acbab0@ams010.satama.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc pgsql-patches |
Hi,
Per the recent discussion there's been some code changes in JDBC's
DatabaseMetaData.getColumn(). I proposed a patch that would change the
number of queries to find out all columns in a table from 2 * N + 1 to 1 (N
being the number of columns reported) by using some outer joins. I also
fixed the fact that getColumns() only returned columns that had a default
defined. OTOH, I did not use to change the code required for obtaining a
column's remarks (by using col_description() for 7.2 and requested by Tom
Lane).
Finally, I have found a way to get all the column details in a single query
*and* use col_description() for 7.2 servers. A patch is attached. It
overrules René Pijlman's fix for this that was committed just today, but
still used N + 1 queries (sorry René ;-) )
I also fixed the return values for TABLE_CAT and TABLE_SCHEM from "" to
null, to be more standard compliant (and requested in René's mail found at
http://fts.postgresql.org/db/mw/msg.html?mid=1034253).
As always, the JDBC1 version has not been tested as I have no JDK 1.1
available.
Please review,
Jeroen
Attachment | Content-Type | Size |
---|---|---|
DatabaseMetaData.diff.gz | application/octet-stream | 3.1 KB |
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Jeroen van Vianen <jeroen(dot)van(dot)vianen(at)satama(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [PATCHES] Fix for broken JDBC's getColumn() (take 2) |
Date: | 2001-09-27 19:37:14 |
Message-ID: | 200109271937.f8RJbED16660@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc pgsql-patches |
Your patch has been added to the PostgreSQL unapplied patches list at:
http://candle.pha.pa.us/cgi-bin/pgpatches
I will try to apply it within the next 48 hours.
> Hi,
>
> Per the recent discussion there's been some code changes in JDBC's
> DatabaseMetaData.getColumn(). I proposed a patch that would change the
> number of queries to find out all columns in a table from 2 * N + 1 to 1 (N
> being the number of columns reported) by using some outer joins. I also
> fixed the fact that getColumns() only returned columns that had a default
> defined. OTOH, I did not use to change the code required for obtaining a
> column's remarks (by using col_description() for 7.2 and requested by Tom
> Lane).
>
> Finally, I have found a way to get all the column details in a single query
> *and* use col_description() for 7.2 servers. A patch is attached. It
> overrules Ren? Pijlman's fix for this that was committed just today, but
> still used N + 1 queries (sorry Ren? ;-) )
>
> I also fixed the return values for TABLE_CAT and TABLE_SCHEM from "" to
> null, to be more standard compliant (and requested in Ren?'s mail found at
> http://fts.postgresql.org/db/mw/msg.html?mid=1034253).
>
> As always, the JDBC1 version has not been tested as I have no JDK 1.1
> available.
>
> Please review,
>
>
> Jeroen
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Jeroen van Vianen <jeroen(dot)van(dot)vianen(at)satama(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [PATCHES] Fix for broken JDBC's getColumn() (take 2) |
Date: | 2001-09-29 03:08:12 |
Message-ID: | 200109290308.f8T38CE00250@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc pgsql-patches |
Patch applied. Thanks.
> Hi,
>
> Per the recent discussion there's been some code changes in JDBC's
> DatabaseMetaData.getColumn(). I proposed a patch that would change the
> number of queries to find out all columns in a table from 2 * N + 1 to 1 (N
> being the number of columns reported) by using some outer joins. I also
> fixed the fact that getColumns() only returned columns that had a default
> defined. OTOH, I did not use to change the code required for obtaining a
> column's remarks (by using col_description() for 7.2 and requested by Tom
> Lane).
>
> Finally, I have found a way to get all the column details in a single query
> *and* use col_description() for 7.2 servers. A patch is attached. It
> overrules Ren? Pijlman's fix for this that was committed just today, but
> still used N + 1 queries (sorry Ren? ;-) )
>
> I also fixed the return values for TABLE_CAT and TABLE_SCHEM from "" to
> null, to be more standard compliant (and requested in Ren?'s mail found at
> http://fts.postgresql.org/db/mw/msg.html?mid=1034253).
>
> As always, the JDBC1 version has not been tested as I have no JDK 1.1
> available.
>
> Please review,
>
>
> Jeroen
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026