From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Object types and ResultSets (java.sql.Struct)
Date: Sat, 23 Jan 2010 17:39:46 +0100
Message-ID: <hjf8o6$m49$1@ger.gmane.org> (raw)
Hi,
I noticed that "object types" are not treated in a consistent manner
Taking the following table:
CREATE TYPE person_type AS
(
first_name VARCHAR(20),
last_name VARCHAR(25)
)
CREATE TABLE contacts
(
id integer,
contact person_type
)
DatabaseMetaData.getColumns() will return a java.sql.Types.STRUCT for the column "contact".
That seems to be correct to me - at least this is what I expected ;)
When running a "SELECT * FROM contacts", ResultSetMetaData.getColumnType() will return java.sql.Types.OTHER (for the contact column)
This seems to be inconsistent to me.
My expectation was that ResultSetMetaData.getColumnType() should also return java.sql.Types.STRUCT and that the object returned by getObject() on the ResultSet should implement java.sql.Struct (which it doesn't)
Regards
Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: Object types and ResultSets (java.sql.Struct)
In-Reply-To: <hjf8o6$m49$1@ger.gmane.org>
References: <hjf8o6$m49$1@ger.gmane.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox