Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4F40E1337B58 for ; Mon, 20 Sep 2010 08:13:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 19574-03 for ; Mon, 20 Sep 2010 11:13:21 +0000 (UTC) X-Greylist: delayed 00:17:18.453795 by SQLgrey-1.7.6 Received: from fep27.mx.upcmail.net (fep27.mx.upcmail.net [62.179.121.47]) by mail.postgresql.org (Postfix) with ESMTP id 828F61337B2A for ; Mon, 20 Sep 2010 08:13:19 -0300 (ADT) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep11-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100920105558.OKPD4509.viefep11-int.chello.at@edge02.upcmail.net> for ; Mon, 20 Sep 2010 12:55:58 +0200 Received: from catv-86-101-163-116.catv.broadband.hu ([86.101.163.116]) by edge02.upcmail.net with edge id 8yvw1f01u2WzZim02yvxxS; Mon, 20 Sep 2010 12:55:57 +0200 X-SourceIP: 86.101.163.116 Date: Mon, 20 Sep 2010 12:55:55 +0200 From: Daniel Dekany Reply-To: Daniel Dekany X-Priority: 3 (Normal) Message-ID: <255315797.20100920125555@freemail.hu> To: pgsql-jdbc@postgresql.org Subject: Bug? Reading items of array of composite a type MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Cloudmark-Analysis: v=1.1 cv=ZDt3ILgE3VX9xkJc7+9REBIC4hFTL6V7NAq0V56QRNQ= c=1 sm=0 a=Gq5xMUFJc5oA:10 a=-CRmgG0JhlAA:10 a=_So7fUQMAAAA:8 a=YZOrZIYksObGoddiWocA:9 a=QCAn2H6mhXr9IUY47QMA:7 a=RrILVeeeWvIE00RNTGBtJoS5hmMA:4 a=jiObf9B0YAUA:10 a=q-PRSMt6rt4A:10 a=RNDHIwyGQ1cA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_40=-0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201009/41 X-Sequence-Number: 20911 (Sorry for this is a duplicate of http://pgfoundry.org/tracker/index.php?func=detail&aid=1010898&group_id=1000224&atid=854 but now I guess it's unused and you expect reports here?) The items of an array of composite items are returned so that the composite values will only have their first field returned correctly, the second field will be a PGObject that represents the whole composite value, and there will not be more fields. Example: ResultSet rs = con.createStatement().executeQuery( "SELECT ARRAY[ROW(1,2,3)::some_composite_type]"); while (rs.next()) { ResultSet arrayRs = rs.getArray(1).getResultSet(); while (arrayRs.next()) { assert(arrayRs.getObject(1), 1); // Passes assert(arrayRs.getObject(2), 2); // Fails, it's PGObject "(1,2,3)" assert(arrayRs.getObject(3), 3); // Exception: there's only 2 columns } } This same issue doesn't appear if the composite value is not an item of an array. Versions: postgresql-8.4-702.jdbc4.jar and postgresql-9.0dev-800.jdbc4.jar PostgreSQL 8.3.11 (Win32) Java 1.6.0_20-b02 Working demonstration code: http://pgfoundry.org/tracker/download.php/1000224/854/1010898/547/PgJDBCBugDemo.java -- Best regards, Daniel Dekany