Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4040B632EC2 for ; Tue, 10 Aug 2010 18:01:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 38096-03 for ; Tue, 10 Aug 2010 21:00:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ns1.officenet.no (unknown [195.159.87.244]) by mail.postgresql.org (Postfix) with ESMTP id 38E9E632586 for ; Tue, 10 Aug 2010 18:00:56 -0300 (ADT) Received: from [79.161.204.50] (helo=[192.168.0.186]) by ns1.officenet.no with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OivwI-0002EO-Ss for pgsql-jdbc@postgresql.org; Tue, 10 Aug 2010 23:00:53 +0200 Message-ID: <4C61BE01.8010505@officenet.no> Date: Tue, 10 Aug 2010 23:00:49 +0200 From: Andreas Joseph Krogh User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100527 Thunderbird/3.0.5 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Object types and ResultSets (java.sql.Struct) References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------000605000804020408030402" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.106 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201008/44 X-Sequence-Number: 20847 This is a multi-part message in MIME format. --------------000605000804020408030402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 08/10/2010 10:00 PM, Kris Jurka wrote: > > > On Fri, 29 Jan 2010, Kris Jurka wrote: > >> On Sat, 23 Jan 2010, Thomas Kellerer wrote: >> >>> 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 >> >> That should be easy enough to fix. I'll take a look. > > I've applied a fix to this for 8.3, 8.4, and 9.0 in CVS. > What about this? >> and that the object returned by getObject() on the >> ResultSet should implement java.sql.Struct (which it doesn't) > >That one will take some more work. I wouldn't hold my breath on that one. Without proper support for Struct returning custom-types (i.e. arrays of arrays) becomes a pain. Any word on this? -- Andreas Joseph Krogh Senior Software Developer / CTO ------------------------+---------------------------------------------+ OfficeNet AS | The most difficult thing in the world is to | Rosenholmveien 25 | know how to do a thing and to watch | 1414 Trollåsen | somebody else doing it wrong, without | NORWAY | comment. | | | Tlf: +47 24 15 38 90 | | Fax: +47 24 15 38 91 | | Mobile: +47 909 56 963 | | ------------------------+---------------------------------------------+ --------------000605000804020408030402 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 08/10/2010 10:00 PM, Kris Jurka wrote:


On Fri, 29 Jan 2010, Kris Jurka wrote:

On Sat, 23 Jan 2010, Thomas Kellerer wrote:

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

That should be easy enough to fix.  I'll take a look.

I've applied a fix to this for 8.3, 8.4, and 9.0 in CVS.


What about this?
>>  and that the object returned by getObject() on the
>> ResultSet should implement java.sql.Struct (which it doesn't)
>
>That one will take some more work.  I wouldn't hold my breath on that one.

Without proper support for Struct returning custom-types (i.e. arrays of arrays) becomes a pain. Any word on this?
-- 
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / CTO
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Rosenholmveien 25       | know how to do a thing and to watch         |
1414 Trollåsen          | somebody else doing it wrong, without       |
NORWAY                  | comment.                                    |
                        |                                             |
Tlf:    +47 24 15 38 90 |                                             |
Fax:    +47 24 15 38 91 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+
--------------000605000804020408030402--