pg_duckdb
pg_duckdb copied to clipboard
Fix crash on `SAVEPOINT` is not supported
Fixes #761, #820
Some thoughts: I think this direction could very well be the correct solution. I'd like to discuss this on the Postgres mailing list first though, since this only became a problem in PG17.
Two main thoughts that I'd like to write down:
- If we do this approach, we should error earlier. e.g. in the executor/planner hook. Not only when actually executing something.
- Another idea that I think would obsolete this, is to actually allow some SAVEPOINT usages in combination with duckdb. As long as people don't use ROLLBACK TO SAVEPOINT to rollback changes from a DuckDB transaction, then there's no reason why we couldn't support that. So basically the idea would be to allow creating savepoints in transaction that did duckdb queries, but when a rollback to a savepoint happens we need to make sure all duckdb changes were before that savepoint.