From 0c8dc73bf403885cfd81f6f4a2ec7effa1a6f428 Mon Sep 17 00:00:00 2001 From: Utkarash Kumar Singh Date: Tue, 1 Sep 2026 13:42:06 +0100 Subject: [PATCH] feat(upgrade): surface btree_gist NaN reindex warning (#49684) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Feature — studio counterpart of supabase/platform#37696 (PG 15.19/17.11 release, PSQL-1247). ## What is the current behavior? The pre-upgrade warnings panel handles `ltree_reindex_required` and `operator_estimator_gate` only. ## What is the new behavior? Adds the `btree_gist_nan_reindex` warning (title, description, docs link) emitted by the eligibility endpoint when a project has btree_gist indexes on float columns and the upgrade crosses the 15.19/17.11 NaN-handling fix. Non-blocking, same pattern as #47003. `api-v1.d.ts` union extended to match the platform spec. ## Additional context Docs anchor targets the section added in #49621 — merge that first (or together). Refs PSQL-1247. ## Summary by CodeRabbit * **New Features** * Added an upgrade warning for the `btree_gist_nan_reindex` requirement. * Included a description and link to relevant documentation for guidance. --- .../interfaces/Settings/Infrastructure/UpgradeWarnings.tsx | 6 ++++++ packages/api-types/types/api-v1.d.ts | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx index a5204a403db..7ebf1c69721 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx @@ -164,6 +164,8 @@ const getWarningTitle = (warning: ProjectUpgradeEligibilityWarning): string => { return 'ltree indexes must be reindexed after this upgrade' case 'operator_estimator_gate': return 'Custom operators may need attention after this upgrade' + case 'btree_gist_nan_reindex': + return 'btree_gist indexes on float columns must be reindexed after this upgrade' } } @@ -175,6 +177,8 @@ const getWarningDescription = (warning: ProjectUpgradeEligibilityWarning): strin return 'After upgrading, ltree indexes on this database can return incomplete results until they are rebuilt. Run `REINDEX INDEX CONCURRENTLY` on the affected indexes — this runs online with no downtime.' case 'operator_estimator_gate': return 'After upgrading, recreating an operator that references a non-built-in selectivity estimator (for example during a restore or branch) requires superuser and may fail. Most projects are not affected.' + case 'btree_gist_nan_reindex': + return 'After upgrading, btree_gist indexes on float columns can return wrong results for rows containing NaN until they are rebuilt. If those columns may contain NaN values, run `REINDEX INDEX CONCURRENTLY` on the affected indexes — this runs online with no downtime.' } } @@ -186,6 +190,8 @@ const getWarningLink = (warning: ProjectUpgradeEligibilityWarning): string => { return `${DOCS_URL}/guides/platform/upgrading#ltree-indexes-require-reindexing-after-upgrade` case 'operator_estimator_gate': return `${DOCS_URL}/guides/platform/upgrading#custom-operator-selectivity-estimators` + case 'btree_gist_nan_reindex': + return `${DOCS_URL}/guides/platform/upgrading#btree_gist-indexes-on-float-columns-require-reindexing-after-upgrade` } } diff --git a/packages/api-types/types/api-v1.d.ts b/packages/api-types/types/api-v1.d.ts index b7d26dcb49d..1a8ef0636fb 100644 --- a/packages/api-types/types/api-v1.d.ts +++ b/packages/api-types/types/api-v1.d.ts @@ -4045,6 +4045,10 @@ export interface components { /** @enum {string} */ type: 'operator_estimator_gate' } + | { + /** @enum {string} */ + type: 'btree_gist_nan_reindex' + } )[] } ProjectUpgradeInitiateResponse: {