if (value.toString().equals("varchar")) { value = LongValue.create(-1); } else { value = result.getFieldLength(env, fieldNumber);
fieldNumber++;  int dataType = metaData.getColumnType(fieldNumber);  int size = -1;  switch (dataType) { case Types.BIT: { String typeName = metaData.getColumnTypeName(fieldNumber); if (typeName.equals("bool")) { size = 1; } break; }  case Types.TINYINT: size = 1; break;  case Types.SMALLINT: size = 2; break;  case Types.DATE: case Types.FLOAT: case Types.INTEGER: case Types.REAL: size = 4; break;  case Types.BIGINT: case Types.DOUBLE: { size = 8; String typeName = metaData.getColumnTypeName(fieldNumber); if (typeName.equals("money")) { size = 4; } } break;  case Types.TIME: case Types.TIMESTAMP: size = 8;   default: { String typeName = metaData.getColumnTypeName(fieldNumber); if (typeName.equals("timetz") || typeName.equals("interval")) { size = 12; } else if (typeName.equals("macaddr")) { size = 6; } else if (typeName.equals("point")) { size = 16; } else if (typeName.equals("circle")) { size = 24; } else if (typeName.equals("box") || typeName.equals("lseg")) { size = 32; } }
  public static Value pg_field_size(Env env,                                    @NotNull PostgresResult result,                                    int fieldNumber)  {    try {      Value value = pg_field_type(env, result, fieldNumber);      if (value.toString().equals("varchar")) {        value = LongValue.create(-1);      } else {        value = result.getFieldLength(env, fieldNumber);      }      return value;    } catch (Exception ex) {      log.log(Level.FINE, ex.toString(), ex);      return BooleanValue.FALSE;    }  }