DatabaseMetaData.getColumns does not return full qualified type

From: Christian Schröder <Christian(dot)Schroeder(at)deriva(dot)de>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Cc: Jan Strube <Jan(dot)Strube(at)deriva(dot)de>
Subject: DatabaseMetaData.getColumns does not return full qualified type
Date: 2016-05-02 15:35:03
Message-ID: 237e687b468c4497b08875a9022e5933@MSEX-04-FRA9.corp.solvians.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi list,
The "DatabaseMetaData.getColumns" method returns a result set with metadata for a table. This result set has a column "TYPE_NAME", which should contain the database type name. According to the documentation, "for a UDT the type name is fully qualified".
However, the current implementation does never return a fully qualified value. This can be easily proven by creating an enum (or a domain type) in a schema other than "public", using this type in a table and then querying the metadata for this table.
The type name is fetched in the "getPGType" method of the "TypeInfoCache" using the following query (for database version > 7.3): SELECT typname FROM pg_catalog.pg_type WHERE oid = ?. This query could easily be extended to fetch the schema name together with the type name.
Is there a reason for the current behavior? Or is it a bug? Should I create a bug in GitHub, or simply provide a patch?

Regards,
Christian

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2016-05-02 18:24:08 Re: DatabaseMetaData.getColumns does not return full qualified type
Previous Message Dave Cramer 2016-04-26 09:24:59 Re: Fw: Column order seems to play a role after migration from 8.1 to 9.1 if sequences are used