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
Generated diff has incorrect syntax #1849
Comments
@pematt The original problem is fixed. However, the generated diff still has a semantic problem that I still need to figure out how to solve. After applying the patch the generate code was: -- [ Dropped objects ] --
ALTER TABLE test.test DETACH PARTITION test.test_2024;
-- ddl-end --
ALTER TABLE test.test DETACH PARTITION test.test_2025;
-- ddl-end --
-- [ Created objects ] --
ALTER TABLE test.test ADD COLUMN new_column smallint;
-- ddl-end --
ALTER TABLE test.test ATTACH PARTITION test.test_2024 FOR VALUES FROM ('2024-01-01') TO ('2025-01-01');
-- ddl-end --
ALTER TABLE test.test ATTACH PARTITION test.test_2025 FOR VALUES FROM ('2025-01-01') TO ('2026-01-01');
-- ddl-end -- But if you run the diff above from pgModeler it'll break on the first The lines where It turns out that PostgreSQL converts |
Ok I will do that. Thank you very much for the detailed explanation how to solve it! |
Bug description
When adding a column to a partitioned table and doing a diff then the diff DDL has invalid syntax. Most of the ALTER command appears to be missing.
How to reproduce
test.dbm.zip
test.dbm
model.new_column
to thetest.test
table.The following invalid diff is generated:
Expected behavior
The generated diff code should be syntactically correct.
Screenshots
Info about your desktop
OS: Linux Mint
Version: 21.1
Window manager: Cinnamon
pgModeler version: 1.1.0
Qt version: 6.2.4
The text was updated successfully, but these errors were encountered: