pg_duckdb icon indicating copy to clipboard operation
pg_duckdb copied to clipboard

support "PREPARE" statement and "EXECUTE " statement

Open Z-Xiao-M opened this issue 1 year ago • 1 comments

Current Behavior

postgres=# create extension pg_duckdb;
WARNING:  To actually execute queries using DuckDB you need to run "SET duckdb.execution TO true;"
CREATE EXTENSION
postgres=# SET duckdb.execution TO true;
SET
postgres=# SELECT COUNT(*) FROM t;
 count 
-------
  1000
(1 row)

postgres=# PREPARE test_stmt AS SELECT COUNT(*) FROM t;
PREPARE
postgres=# EXECUTE test_stmt;
 count 
-------
     0
(1 row)

Z-Xiao-M avatar Sep 30 '24 18:09 Z-Xiao-M

Thanks for the bug report. That's indeed something we should fix. However, the usage of prepared statements at the SQL level (i.e. PREPARE/EXECUTE queries) is a lot lower than at the protocol level (Parse/Bind/Execute messages). So I don't consider this a blocker for 0.1.0.

JelteF avatar Oct 01 '24 08:10 JelteF