Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 97A561336FA7 for ; Mon, 22 Nov 2010 05:45:53 -0400 (AST) 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 21289-07 for ; Mon, 22 Nov 2010 09:45:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from progressive.micfo.com (progressive.micfo.com [174.34.188.2]) by mail.postgresql.org (Postfix) with ESMTP id 358B51335B36 for ; Mon, 22 Nov 2010 05:45:45 -0400 (AST) Received: from localhost ([127.0.0.1]:57454 helo=softperience.eu) by progressive.micfo.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1PKSy0-0001w3-1H for pgsql-jdbc@postgresql.org; Mon, 22 Nov 2010 03:45:44 -0600 MIME-Version: 1.0 Date: Mon, 22 Nov 2010 03:45:43 -0600 From: =?UTF-8?Q?Rados=C5=82aw_Smogura?= To: Subject: TypeInfoCache.getPGArrayElement - determine if array Message-ID: X-Sender: rsmogura@softperience.eu User-Agent: RoundCube Webmail/0.3.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - progressive.micfo.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - softperience.eu X-Source: X-Source-Args: X-Source-Dir: 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 X-Spam-Level: X-Archive-Number: 201011/53 X-Sequence-Number: 21174 Hi, In TypeInfo.getPGArrayElement it is written "Returns: the base type's OID, or 0 if unknown", but if given oid isn't array exception is thrown (empty result set), if unknown doesn't means unspecified then following patch ResultSet rs = _getArrayElementOidStatement.getResultSet(); if (!rs.next()) { pgType = Integer.valueOf(0); _pgArrayToPgType.put(new Integer(oid), pgType); }else { pgType = Integer.valueOf((int)rs.getLong(1)); _pgArrayToPgType.put(new Integer(oid), pgType); _pgNameToOid.put(rs.getString(2), pgType); _oidToPgName.put(pgType, rs.getString(2)); } -- ---------- Radosław Smogura http://www.softperience.eu