pg_duckdb
pg_duckdb copied to clipboard
feat: Implement ALTER TABLE SET SCHEMA for DuckDB tables
Description
- Implemented
DuckdbHandleAlterTableSetSchemato support moving DuckDB tables between schemas within the same database. - Updated DDL interception to call this handler instead of raising an error.
- Added regression tests covering error scenarios for non-existent tables/schemas.
Testing
- Ran make check to verify Postgres regression tests pass.
- Manually created DuckDB tables, moved them between schemas with
ALTER TABLE … SET SCHEMA, and confirmed data is preserved. - Ran
make pychecklocally (without MotherDuck token) to ensure non-MotherDuck Python (19)tests pass.
Fixes #781.
Thanks for the feedback, @JelteF I’ve updated the PR description to be more focused. This PR only covers moving DuckDB tables within the same database, I’ll address the remaining requirements in a follow-up commit.
I had tested locally with make check and by manually moving tables between schemas. I also ran make pycheck without a MotherDuck token, so I haven’t validated against MotherDuck yet. Could you point me to how I can obtain a test token for that?
Thanks a lot for the contribution, but I'm starting to think that we should simply not support this until duckdb itself actually has support for this command.