Add detection of out-of-bound NUMERICs (1.5) - #563
Merged
staticlibs merged 1 commit intoSep 1, 2026
Conversation
staticlibs
force-pushed
the
out_of_bound_numerics_15
branch
from
September 1, 2026 18:47
fedb875 to
b80db7c
Compare
This is a backport of the PR duckdb#562 to `v1.5-variegata` stable branch. This PR adds detection of `NaN`, `Infinity` and `-Infinity` values of Postgres' `NUMERIC` colums with the following logic: - for bound `NUMERIC(p,s)` columns: - if options `pg_numeric_nan_as_null` is enabled (default: `TRUE`) - `NULL` is returned on `NaN` value - otherwise, an error is thrown - Postgres bound `NUMERIC(p,s)` columns cannot hold `Infinity` or `-Infinity` values - for unbound `NUMERIC` columns: - if option `pg_numeric_as_varchar` is enabled (default: `FALSE`) - then a `VARCHAR` representation is returned as `NaN`, `Infinity` or `-Infinity` string - otherwise `DOUBLE` value is returned holding DuckDB-native `NaN`, `Infinity` or `-Infinity` double number Testing: new test is added with an out-of-bound coverage of both options and of all `NUMERIC` storage types. Ref: duckdb/duckdb#23971
staticlibs
force-pushed
the
out_of_bound_numerics_15
branch
from
September 1, 2026 19:00
b80db7c to
8813d8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of the PR #562 to
v1.5-variegatastable branch.This PR adds detection of
NaN,Infinityand-Infinityvalues of Postgres'NUMERICcolums with the following logic:for bound
NUMERIC(p,s)columns:pg_numeric_nan_as_nullis enabled (default:TRUE) -NULLis returned onNaNvalueNUMERIC(p,s)columns cannot holdInfinityor-Infinityvaluesfor unbound
NUMERICcolumns:pg_numeric_as_varcharis enabled (default:FALSE) - then aVARCHARrepresentation is returned asNaN,Infinityor-InfinitystringDOUBLEvalue is returned holding DuckDB-nativeNaN,Infinityor-Infinitydouble numberTesting: new test is added with an out-of-bound coverage of both options and of all
NUMERICstorage types.Ref: duckdb/duckdb#23971