Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepared statments, and stored procedures are not working properly. #396

Open
2 tasks done
zhousun opened this issue Nov 6, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@zhousun
Copy link

zhousun commented Nov 6, 2024

What happens?

When prepare have parameters, duckdb will fail to bind the types, and latter rely on execution to rebind them with actual values.

But pg_duckdb is using it in an incorrect way, assuming Prepare will fully resolve all the types without providing actual values.

To Reproduce

postgres=# prepare test(int) as select * from a where a>$1+1; 
PREPARE    
postgres=# execute test(1);
WARNING:  (PGDuckDB/GetPostgresDuckDBType) Could not convert DuckDB type: UNKNOWN to Postgres type
WARNING:  (PGDuckDB/CreatePlan) Cache lookup failed for type 0
 a 
---
(0 rows)

OS:

MacOs

pg_duckdb Version:

0.1.0

Postgres Version:

16

Hardware:

No response

Full Name:

Zhou

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?

No - Other reason (please specify in the issue body)

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
@JelteF JelteF added the bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants