From: Kris Jurka <books@ejurka.com>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Driver not returning the type for TYPEs
Date: Sat, 1 May 2010 12:56:09 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1005011252560.13830@leary.csoft.net> (raw)
In-Reply-To: <hn1acl$95j$1@dough.gmane.org>
References: <hn16q4$upd$1@dough.gmane.org>
<hn1acl$95j$1@dough.gmane.org>
On Sun, 7 Mar 2010, Thomas Kellerer wrote:
>> When creating types using e.g.:
>>
>> CREATE TYPE my_tabpe AS (some_data varchar(100));
>>
>> DatabaseMetaData.getTables() will return that type, but the value for
>> the column TABLE_TYPE is null.
>>
>> I think if the driver returns non-table objects (which is fine, a lot of
>> drivers are doing that), the TABLE_TYPE column of the result set should
>> contain a proper value.
>>
>
> I had a quick look at the source code, and it seems quite simple to fix.
>
> I have attached a patch agains CVS head which (as far as I can tell)
> fixes this. It also supports getTables() passing "TYPE" in the String
> array to select which types to show.
>
> I hope the patch is OK, I have not used the diff tool before ;)
>
I've applied this with additional code to separate out temporary views and
temporary sequences. A couple of notes on your patch for future
reference:
1) You have it reversed. The patch is taking out your changes rather than
adding them.
2) There are two CASE statements that convert relkind to TABLE_TYPE and
you only got one of them.
Kris Jurka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, spam_eater@gmx.net
Subject: Re: Driver not returning the type for TYPEs
In-Reply-To: <alpine.BSO.2.00.1005011252560.13830@leary.csoft.net>
References: <hn16q4$upd$1@dough.gmane.org> <hn1acl$95j$1@dough.gmane.org> <alpine.BSO.2.00.1005011252560.13830@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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