Skip to content

fix(0030): detect autovacuum_enabled set to off, 0 or no - #208

Open
RaphaelFakhri wants to merge 1 commit into
supabase:mainfrom
RaphaelFakhri:fix/0030-autovacuum-boolean-spellings
Open

RaphaelFakhri wants to merge 1 commit into
supabase:mainfrom
RaphaelFakhri:fix/0030-autovacuum-boolean-spellings

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix.

What is the current behavior?

Lint 0030_autovacuum_disabled checks 'autovacuum_enabled=false' = any(cls.reloptions). Postgres stores a boolean storage parameter as written, so with (autovacuum_enabled = off) is stored as autovacuum_enabled=off and the lint returns no rows. The same applies to 0, no, 'False' and the other spellings Postgres accepts for false.

What is the new behavior?

The lint unnests reloptions, picks the autovacuum_enabled entry and casts its value to boolean. Postgres validated the value when it stored it, so the cast always succeeds, and any spelling of false now reports the table. splinter.sql is rebuilt with bin/compile.py.

The test for 0030 adds:

  • A negative case with autovacuum_enabled = on.
  • Positive cases with off, 0 and '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 where clause, so the output columns, detail text and cache_key stay the same.

Fixes #207

@RaphaelFakhri
RaphaelFakhri requested a review from a team as a code owner October 25, 2026 00:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0030_autovacuum_disabled misses tables where autovacuum_enabled is set to off, 0 or no

1 participant