Re: Driver not returning the type for TYPEs

From: Kris Jurka <books(at)ejurka(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Driver not returning the type for TYPEs
Date: 2010-05-01 16:56:09
Message-ID: alpine.BSO.2.00.1005011252560.13830@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Pierre Queinnec 2010-05-01 16:59:14 Concurrency issue in EscapedFunctions
Previous Message Kris Jurka 2010-05-01 16:20:19 Re: SQLException.getErrorCode ?