Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id F3624632DF3 for ; Sat, 1 May 2010 13:56:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 37529-09 for ; Sat, 1 May 2010 16:56:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id E85D0632B62 for ; Sat, 1 May 2010 13:56:11 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 941F128404; Sat, 1 May 2010 12:56:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=SLaVqr45KDLzZEAPSx+Zg2F5Jbs=; b=Mb8Xg0 +z/lRTkVxjg+avZ3iEWMyhNqyHQuyB262BqshDSnWSolewJODvCNTYM4etOlgnBv aHcQadlRxLqEo5B0xFETizhUMS2ZJtfTrQDfxoZBHLqK4DRU4bUTl6gOGg++SWui bzwi/2Fdj/O5xUiu28vUTtj7RWX4t/pdvtchw= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 60B0328415; Sat, 1 May 2010 12:56:10 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 3459CA388; Sat, 1 May 2010 12:56:10 -0400 (EDT) Date: Sat, 1 May 2010 12:56:09 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Thomas Kellerer cc: pgsql-jdbc@postgresql.org Subject: Re: Driver not returning the type for TYPEs In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/12 X-Sequence-Number: 20496 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