final String name = rsMetaData.getColumnName(i);
// TODO pribeiro We should use polymorphism here. Build like a chain
if ((obj instanceof PGobject) && ((PGobject) obj).getType().equals("record")) {
final PGobject pgObj = (PGobject) obj;
final DbFunction function = DbFunctionRegister.getFunction(name, pgSet.getStatement().getConnection());
List<String> fieldValues;
try {
fieldValues = ParseUtils.postgresROW2StringList(pgObj.getValue());
} catch (final RowParserException e) {
throw new SQLException(e);
}
int j = 1;
for (final String fieldValue : fieldValues) {
final DbTypeField fieldDef = function.getFieldByPos(j);
DbResultNode currentNode = null;
if (fieldDef.getType().equals("USER-DEFINED")) {
currentNode = new ObjectResultNode(fieldValue, fieldDef.getName(), fieldDef.getTypeName(),
fieldDef.getTypeId(), pgSet.getStatement().getConnection());
} else if (fieldDef.getType().equals("ARRAY")) {