Repository navigation
fix(0030): detect autovacuum_enabled set to off, 0 or no - #208
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
What kind of change does this PR introduce?
Bug fix.
What is the current behavior?
Lint
0030_autovacuum_disabledchecks'autovacuum_enabled=false' = any(cls.reloptions). Postgres stores a boolean storage parameter as written, sowith (autovacuum_enabled = off)is stored asautovacuum_enabled=offand the lint returns no rows. The same applies to0,no,'False'and the other spellings Postgres accepts for false.What is the new behavior?
The lint unnests
reloptions, picks theautovacuum_enabledentry and casts its value toboolean. Postgres validated the value when it stored it, so the cast always succeeds, and any spelling of false now reports the table.splinter.sqlis rebuilt withbin/compile.py.The test for 0030 adds:
autovacuum_enabled = on.off,0and'no', which all report a row.Before the fix, the new positive case returns 0 rows. After the fix, it returns 3 rows. The full suite passes on
15.14.1.169(29 of 29 tests), and the 0030 test also passes on Postgres 17.Additional context
The fix only touches the
whereclause, so the output columns,detailtext andcache_keystay the same.Fixes #207