Skip to content
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

Support for different, yet compatible, DDL for the rewritten table #18

Closed
ahachete opened this issue Mar 24, 2019 · 1 comment
Closed

Comments

@ahachete
Copy link

This is related to, a generalization, of #15. That issue provides a good example of a good use case.

Since pg_squeeze uses logical replication, it is possible to use a destination table with a DDL potentially different from that of the source table, as long as they are compatible. You may add NULLABLE, DEFAULT columns or even modify data types.

Doing an ALTER TABLE and then an UPDATE is a very heavy operation for many environments, rendering it unacceptable. The current fix is to write complex logic for progressive batch updates which is very failure prone.

I cannot estimate difficulty of this, as mentioned before, but I'd say it would be a very welcome addition.

@ahouska
Copy link
Contributor

ahouska commented May 3, 2019

I don't know how pg_squeeze could use parts of the ALTER TABLE functionality without copy&pasting big parts of PG source. And this is about ALTER TABLE if we want to treat catalog dependencies correctly.For example, if there's a CHECK constraint on a column whose data type should be changed by pg_squeeze, the constraint needs to be adjusted too. Or if there's an index on the column, catalog entry of that index needs to be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants