docs: private long readLongValue(byte[] bytes, int oid, long minVal, long maxVal, String targetType)
        throws PSQLException {
      long val;
      // currently implemented binary encoded fields
      switch (oid) {
        case Oid.INT2:
          val = ByteConverter.int2(bytes, 0);
          break;
        case Oid.INT4:
          val = ByteConverter.int4(bytes, 0);
          break;
        case Oid.INT8:
          val = ByteConverter.int8(bytes, 0);
          break;
        case Oid.FLOAT4:
          val = (long) ByteConverter.float4(bytes, 0);
          break;
        case Oid.FLOAT8:
          val = (long) ByteConverter.float8(bytes, 0);
          break;
        default:
          throw new PSQLException(
              GT.tr("Cannot convert the column of type {0} to requested type {1}.",
                  Oid.toString(oid), targetType),
              PSQLState.DATA_TYPE_MISMATCH);
      }
      if (val < minVal || val > maxVal) {
        throw new PSQLException(GT.tr("Bad value for type {0} : {1}", targetType, val),
            PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
      }
      return val;
    }