Skip to content

Can't convert string "NaN" to DECIMAL(18,3) in Duckdb_ExecCustomScan_Cpp #1039

@emarsden

Description

@emarsden

What happens?

Though the expression SELECT 'NaN'::numeric works fine, the expression SELECT SUM('NaN'::numeric) FROM generate_series(1,3) triggers an error.

To Reproduce

pgeltestdb=# SELECT SUM('NaN'::numeric) FROM generate_series(1,3);
 sum
-----
 NaN
(1 ligne)

pgeltestdb=# SET duckdb.force_execution = true;
SET
pgeltestdb=# SELECT SUM('NaN'::numeric) FROM generate_series(1,3);
ERROR:  (PGDuckDB/Duckdb_ExecCustomScan_Cpp) Conversion Error: Could not convert string "NaN" to DECIMAL(18,3)

LINE 1:  SELECT sum('NaN'::numeric) AS sum FROM generate_series(1, 3) generate_series...
                         ^

OS:

Linux

pg_duckdb Version (if built from source use commit hash):

Current Dockerhub image, docker.io/pgduckdb/pgduckdb:18-main

Postgres Version (if built from source use commit hash):

PostgreSQL 18.3 (Debian 18.3-1.pgdg12+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14+deb12u1) 12.2.0, 64-bit

Hardware:

No response

Full Name:

Eric Marsden

Affiliation:

None

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions