Casting arrays to VECTOR: Overflow now returns an error (Pending)

Attention

This behavior change is in the 2026_07 bundle.

For the current status of the bundle, refer to Bundle history.

When the 2026_07 behavior change bundle is enabled in your account, the behavior of casting an array to a VECTOR (using the ::VECTOR or CAST( ... AS VECTOR( ... )) syntax) improves for array input values that overflow the target type. For more information about the VECTOR data type and casting, see VECTOR.

Before the change:
  • When casting an array to an INT vector, values outside the INT32 range were silently truncated without an error.
  • When casting an array to a FLOAT vector, double-precision values that exceeded the float32 range were silently wrapped to ±Inf without an error.
After the change:
  • INT overflow is now an error: Integer values that don’t fit in INT32 now return an explicit error instead of being silently truncated:
-- Now throws: "Array-like value being cast to an integer vector has elements that overflow"
SELECT [3000000000]::VECTOR(INT, 1);
  • FLOAT overflow is now an error: Double-precision values that exceed the float32 range now return an explicit error instead of being silently wrapped to ±Inf:
-- Now throws: "Array-like value being cast to a float vector has elements that overflow"
SELECT [1e40]::VECTOR(FLOAT, 1);

This can be a breaking change if you rely on either of the following behaviors:

  • Large integers (outside the INT32 range of approximately ±2.1 billion) being silently truncated when you cast to VECTOR(INT, N).
  • Out-of-range double-precision values silently becoming ±Inf when you cast to VECTOR(FLOAT, N).

If you’re affected, review the array values that you cast to VECTOR to make sure that all elements are within the target type’s representable range before the bundle is enabled.

Ref: 2361