duckdb / postgres_scanner

https://duckdb.org/docs/extensions/postgres
MIT License
227 stars 36 forks source link

Fix #149 - store snapshot id in global state instead of bind data to make postgres scan work correctly with prepared statements #150

Closed Mytherin closed 9 months ago

Mytherin commented 9 months ago

Fixes #149

The problem with storing the snapshot id in the bind data is that the bind is called during the preparation of a query, but if the prepare is separate from the execute (which is the case in e.g. the JDBC client) the snapshot id will have expired by the time we reach the actual query execution causing the query to fail.