Skip to content

pgduckdb_get_querydef() ignores certain type conversion #561

Open
@dpxcc

Description

@dpxcc

What happens?

Certain type conversions are ignored by pgduckdb_get_querydef(), resulting in the query not runnable by DuckDB

To Reproduce

SET duckdb.force_execution TO true;
WITH t as (SELECT chr((126983+i)::int) FROM generate_series(0,26) t(i)) SELECT * FROM t; -- warning

throws warning

WARNING:  (PGDuckDB/CreatePlan) Prepared query returned an error: 'Binder Error: No function matches the given name and argument types 'chr(BIGINT)'. You might need to add explicit type casts.
        Candidate functions:
        chr(INTEGER) -> VARCHAR

because pgduckdb_get_querydef() ignores the type conversion in (126983+i)::int

OS:

Linux

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

0.2.0

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

17.2

Hardware:

No response

Full Name:

Cheng Chen

Affiliation:

Mooncake Labs

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?

Not applicable - the reproduction does not require a data set

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

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions