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

Ability to reverse the change post swap #14

Open
shayonj opened this issue Jan 30, 2022 · 1 comment
Open

Ability to reverse the change post swap #14

shayonj opened this issue Jan 30, 2022 · 1 comment
Labels
enhancement New feature or request p2 post-launch

Comments

@shayonj
Copy link
Owner

shayonj commented Jan 30, 2022

Idea: pgosc should support the ability to reverse the change (with no data loss) after the alter statements and swap has happened. pgosc should make sure that the data is being replayed in both directions (tables) before and after the swap. So in case of any issues, you can always go back to the original table.

Requires re-acrchitecting some core constructs. Most things should be re-usable.

A separate command/invocation point can be used to go back to the previous state. I am thinking -

  1. Perform alterations as usual without dropping the table in the end (thus making it easier to go back). Example:
pg-online-schema-change perform -a "ALTER..." --drop false ....
  1. Next, perform reversal by providing the primary table name
pg-online-schema-change reverse -t "books"

This involves re-transferring the FKs and running analyze (?).

@shayonj shayonj added enhancement New feature or request p2 labels Jan 30, 2022
@sunilgandipadala
Copy link

Hi @shayonj,

Thank you bringing this feature of getting back of old table, when Can I expect that this feature will be available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p2 post-launch
Projects
None yet
Development

No branches or pull requests

2 participants