Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D3E3E633A4C for ; Sat, 23 Jan 2010 12:40:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 08764-08 for ; Sat, 23 Jan 2010 16:39:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 5F212633BB0 for ; Sat, 23 Jan 2010 12:39:59 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NYj1f-0007aw-4D for pgsql-jdbc@postgresql.org; Sat, 23 Jan 2010 17:39:55 +0100 Received: from ppp-188-174-4-159.dynamic.mnet-online.de ([188.174.4.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Jan 2010 17:39:55 +0100 Received: from spam_eater by ppp-188-174-4-159.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Jan 2010 17:39:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Object types and ResultSets (java.sql.Struct) Date: Sat, 23 Jan 2010 17:39:46 +0100 Lines: 30 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-188-174-4-159.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201001/68 X-Sequence-Number: 20264 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