From: Radosław Smogura <rsmogura@softperience.eu>
To: pgsql-jdbc@postgresql.org
Subject: TypeInfoCache.getPGArrayElement - determine if array
Date: Mon, 22 Nov 2010 03:45:43 -0600
Message-ID: <b4061baf630d6ebb766e790c1910b248@smogura-softworks.eu> (raw)
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
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: rsmogura@softperience.eu
Subject: Re: TypeInfoCache.getPGArrayElement - determine if array
In-Reply-To: <b4061baf630d6ebb766e790c1910b248@smogura-softworks.eu>
References: <b4061baf630d6ebb766e790c1910b248@smogura-softworks.eu>
* 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