Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not drop sequences when dropping metadata (#5584)
Dropping sequences means we need to recreate and hence losing the sequence. With this commit, we keep the existing sequences such that resyncing wouldn't drop the sequence. We do that by breaking the dependency of the sequence from the table.
- Loading branch information
1 parent
8007add
commit 5305aa4
Showing
15 changed files
with
674 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
8 changes: 8 additions & 0 deletions
8
src/backend/distributed/sql/udfs/worker_drop_sequence_dependency/11.0-1.sql
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/backend/distributed/sql/udfs/worker_drop_sequence_dependency/latest.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DROP FUNCTION IF EXISTS pg_catalog.worker_drop_sequence_dependency(table_name text); | ||
|
||
CREATE OR REPLACE FUNCTION pg_catalog.worker_drop_sequence_dependency(table_name text) | ||
RETURNS VOID | ||
LANGUAGE C STRICT | ||
AS 'MODULE_PATHNAME', $$worker_drop_sequence_dependency$$; | ||
COMMENT ON FUNCTION pg_catalog.worker_drop_sequence_dependency(table_name text) | ||
IS 'drop the Citus tables sequence dependency'; |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.