pg_repack is aborted with error if a publication FOR ALL TABLES exist#481
Open
Melkij wants to merge 2 commits intoreorg:masterfrom
Open
pg_repack is aborted with error if a publication FOR ALL TABLES exist#481Melkij wants to merge 2 commits intoreorg:masterfrom
Melkij wants to merge 2 commits intoreorg:masterfrom
Conversation
…s and apply_log requires deleting or updating a row in a temporary table. ERROR: cannot update table "table_16388" because it does not have a replica identity and publishes updates It's not that difficult to format `ALTER TABLE repack.table_' || R.oid || ' REPLICA IDENTITY USING INDEX index_' || PK.indexrelid` in repack.tables, but for this to work, I also need to set NOT NULL on columns, which is less trivial. Furthermore, repack might break subscribers of this publication. Given the lack of previous bug reports (this setup never worked since introduction of publications in pg10), I suggest adding a FOR ALL TABLES check for publications and simply refusing to work in such a database by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pg_repack is aborted with error if a publication FOR ALL TABLES exists and apply_log requires deleting or updating a row in a temporary table.
Reproduction:
It's not that difficult to format
ALTER TABLE repack.table_' || R.oid || ' REPLICA IDENTITY USING INDEX index_' || PK.indexrelidin repack.tables, but for this to work, I also need to set NOT NULL on columns, which is less trivial. Furthermore, repack might break subscribers of this publication.Given the lack of previous bug reports (this setup never worked since introduction of publications in pg10), I suggest adding a check for publications FOR ALL TABLES and simply refusing to work in such a database by default.