-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove pg_advance_vacuum_cleanup_age() support in PostgreSQL 16 and l…
…ater. pg_advance_vacuum_cleanup_age() relies on vacuum_defer_cleanup_age GUC, which was removed in PostgreSQL 16, making the function unavailable in PostgreSQL 16 and later releases. As a result, compiling pg_cheat_funcs on PostgreSQL 16 resulted in errors. To resolve this issue, this commit drops support for pg_advance_vacuum_cleanup_age() in PostgreSQL 16 and later. The function is now only defined and created for PostgreSQL 15 or earlier releases, ensuring that pg_cheat_funcs can be compiled without issues on those versions.
- Loading branch information
1 parent
cb428ad
commit 0328555
Showing
8 changed files
with
64 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CREATE EXTENSION pg_cheat_funcs; | ||
\pset null '(null)' | ||
DO $$ | ||
DECLARE | ||
orig_cleanup_age text := current_setting('vacuum_defer_cleanup_age'); | ||
BEGIN | ||
PERFORM pg_advance_vacuum_cleanup_age(99); | ||
IF current_setting('vacuum_defer_cleanup_age') <> '-99' THEN | ||
RAISE WARNING 'could not advance vacuum cleanup age properly.'; | ||
END IF; | ||
PERFORM pg_advance_vacuum_cleanup_age(); | ||
IF current_setting('vacuum_defer_cleanup_age') <> orig_cleanup_age THEN | ||
RAISE NOTICE 'could not reset vacuum cleanup age properly.'; | ||
END IF; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
DROP EXTENSION pg_cheat_funcs; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CREATE EXTENSION pg_cheat_funcs; | ||
|
||
\pset null '(null)' | ||
|
||
DO $$ | ||
DECLARE | ||
orig_cleanup_age text := current_setting('vacuum_defer_cleanup_age'); | ||
BEGIN | ||
PERFORM pg_advance_vacuum_cleanup_age(99); | ||
IF current_setting('vacuum_defer_cleanup_age') <> '-99' THEN | ||
RAISE WARNING 'could not advance vacuum cleanup age properly.'; | ||
END IF; | ||
PERFORM pg_advance_vacuum_cleanup_age(); | ||
IF current_setting('vacuum_defer_cleanup_age') <> orig_cleanup_age THEN | ||
RAISE NOTICE 'could not reset vacuum cleanup age properly.'; | ||
END IF; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
|
||
DROP EXTENSION pg_cheat_funcs; |
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