Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhdLY-00043Y-Vu for pgsql-jdbc@arkaria.postgresql.org; Thu, 01 Oct 2015 12:52:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZhdLY-00038l-4T for pgsql-jdbc@arkaria.postgresql.org; Thu, 01 Oct 2015 12:52:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZhdL3-0002af-7P for pgsql-jdbc@postgresql.org; Thu, 01 Oct 2015 12:51:57 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZhdKz-0000RY-T3 for pgsql-jdbc@postgresql.org; Thu, 01 Oct 2015 12:51:56 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZhdKo-0005yp-3e for pgsql-jdbc@postgresql.org; Thu, 01 Oct 2015 14:51:42 +0200 Received: from 185.40.248.10 ([185.40.248.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Oct 2015 14:51:42 +0200 Received: from spam_eater by 185.40.248.10 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Oct 2015 14:51:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: DatabaseMetaData.getTypeInfo() - returns all tables as well Date: Thu, 1 Oct 2015 14:51:28 +0200 Lines: 57 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 185.40.248.10 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 In-Reply-To: X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Sorry, I am not registered with GitHub (nor using it) Regards Thomas Dave Cramer schrieb am 01.10.2015 um 13:23: > Hi Thomas, > > Any chance you could provide a github pull request ? > > Dave Cramer > > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca > > On 30 September 2015 at 15:37, Thomas Kellerer > wrote: > > Hello, > > DatabaseMetaData.getTypeInfo() returns not only data types, but also all table types. > > Strictly speaking this is correct as the row type for a table is indeed a "data type" in Postgres, > but I think the information returned is way too much from a practical point of view. > > This could be reduced at least a bit by not only excluding pg_toast, but also pg_catalog and information_schema types: > > SELECT t.typname,t.oid > FROM pg_catalog.pg_type t > JOIN pg_catalog.pg_namespace n ON (t.typnamespace = n.oid) > WHERE n.nspname not in ('pg_toast', 'pg_catalog', 'information_schema') > > (instead of WHERE n.nspname != 'pg_toast' in AbstractJdbc2DatabaseMetaData.java getTypeInfo()) > > > What I find even more confusing (from a JDBC point of view) is that each table type is reported twice: > > Once with the table's name and once with an underscore prefixing the table name, e.g. foo and _foo. > > These entries map to pg_type rows with typtype = 'c' and 'b' respectively. > > I wonder if it would make sense to filter out the "real" tables from this result. > And if it does, if there is an efficient way of doing that and not removing real composite types > from the result at the same time. > > > Regards > Thomas > > > > > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc > > -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc