Обсуждение: DatabaseMetaData.getColumns does not return full qualified type
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 fullyqualified". 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 thistable. 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 schemaname 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
Create a bug in github and a patch would be wonderful!
Thanks
On 2 May 2016 at 11:35, Christian Schröder <Christian.Schroeder@deriva.de> wrote:
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
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Create a bug in github and a patch would be wonderful!
Thanks
On 2 May 2016 at 11:35, Christian Schröder <Christian.Schroeder@deriva.de> wrote:
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
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Hi Dave and list, I have just noticed that this has been implemented in driver version 9.4.1208. So I guess it's time for a driver update.:-) Regards, Christian Von: davecramer@gmail.com [mailto:davecramer@gmail.com] Im Auftrag von Dave Cramer Gesendet: Montag, 2. Mai 2016 20:24 An: Christian Schröder <Christian.Schroeder@deriva.de> Cc: pgsql-jdbc@postgresql.org; Jan Strube <Jan.Strube@deriva.de> Betreff: Re: [JDBC] DatabaseMetaData.getColumns does not return full qualified type Create a bug in github and a patch would be wonderful! Thanks Dave Cramer davec@postgresintl.com www.postgresintl.com On 2 May 2016 at 11:35, Christian Schröder <Christian.Schroeder@deriva.de> wrote: 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 fullyqualified". 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 thistable. 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 schemaname 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 -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc
Hi Dave and list, I have just noticed that this has been implemented in driver version 9.4.1208. So I guess it's time for a driver update.:-) Regards, Christian Von: davecramer@gmail.com [mailto:davecramer@gmail.com] Im Auftrag von Dave Cramer Gesendet: Montag, 2. Mai 2016 20:24 An: Christian Schröder <Christian.Schroeder@deriva.de> Cc: pgsql-jdbc@postgresql.org; Jan Strube <Jan.Strube@deriva.de> Betreff: Re: [JDBC] DatabaseMetaData.getColumns does not return full qualified type Create a bug in github and a patch would be wonderful! Thanks Dave Cramer davec@postgresintl.com www.postgresintl.com On 2 May 2016 at 11:35, Christian Schröder <Christian.Schroeder@deriva.de> wrote: 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 fullyqualified". 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 thistable. 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 schemaname 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 -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc