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

Unable to perform alterations more than once on a table. #151

Open
sunilgandipadala opened this issue Feb 5, 2024 · 2 comments
Open

Unable to perform alterations more than once on a table. #151

sunilgandipadala opened this issue Feb 5, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@sunilgandipadala
Copy link

sunilgandipadala commented Feb 5, 2024

Hi @shayonj ,

I found, that there is an issue with performing the pg-osc command more than once, when we didn't use --drop. When I haven't used --drop and ran the command, it works fine and created a old table. Now, again I tried to run the command on the same table, but now its raising an error as table already exits as below.
ERROR: relation "pgosc_op_table_employees" already exists (PG::DuplicateTable)
Solution:
I guess, when renaming the old table, you may have give the name format as "pgosc_op_table_{tablename}"--> this will cause the error, To resolve this, You may change the format to "pgosc_op_table_{tablename}_{index}"

Here index/id can be a unique value.

@sunilgandipadala
Copy link
Author

sunilgandipadala commented Feb 6, 2024

image

I guess, this has to be updated as
Store.set(:old_primary_table, "pgosc_op_table_#{client.table.downcase}_#{pgosc_identifier}")

image
Which making the feature fails.

@shayonj shayonj added the enhancement New feature or request label Mar 24, 2024
@shayonj
Copy link
Owner

shayonj commented Apr 14, 2024

I am curious, why wouldn't you want to use --drop before the next run? Is it for some analysis sort of thing or perhaps some fail safe mode?

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

No branches or pull requests

2 participants