Skip site navigation (1) Skip section navigation (2)

TypeInfoCache.getPGArrayElement - determine if array

From: Radosław Smogura <rsmogura(at)softperience(dot)eu>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: TypeInfoCache.getPGArrayElement - determine if array
Date: 2010-11-22 09:45:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

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 (! {
            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


pgsql-jdbc by date

Next:From: LewDate: 2010-11-22 13:14:42
Subject: Re: getTables() doesn't handle umlauts correctly
Previous:From: Itagaki TakahiroDate: 2010-11-22 06:37:31
Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group