Skip site navigation (1) Skip section navigation (2)

Re: DatabaseMetadata.getTypeInfo resultset returns more than just Postgres/user defined data types

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: the6campbells <the6campbells(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: DatabaseMetadata.getTypeInfo resultset returns more than just Postgres/user defined data types
Date: 2012-10-02 14:31:56
Message-ID: 506AFADC.3040405@ringerc.id.au (view raw or flat)
Thread:
Lists: pgsql-jdbc
On 09/24/2012 11:12 PM, the6campbells wrote:
> The result set returned from DatabaseMetadata.getTypeInfo contains many
> rows for instance it returns entries for tables and views in schemas.

Everything is in a schema; if you don't specify a schema you just get 
the schema "public" by default.

> This seems inconsistent with the 'spirit' of what this method is
> intended to facilitiate.

It lists all the types. Seems sensible to me. If you want to filter by 
schema, you filter by schema.

Should types in pg_catalog.* be hidden? If so, what if an extension adds 
new types? Should they be listed? What if the *same* extension is 
instead installed into the public schema - should its types be visible, 
or hidden? What about a type created in `pg_temp`?

It's just too messy with an extensible database like PostgreSQL. Without 
a very strong justification based on the JDBC spec for excluding system 
types (and how would we even define "system type"?) I'm strongly against 
changing the current behaviour.

--
Craig Ringer


In response to

pgsql-jdbc by date

Next:From: Gavin FlowerDate: 2012-10-03 02:27:57
Subject: JDBC change log needs updating for Version 9.2-1000
Previous:From: Craig RingerDate: 2012-10-02 14:26:57
Subject: Re: ResultSet metadata for a prepared statement missing the applicable table, schema etc properties

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group