fix(pg_upgrade): guard wrappers server-options patch on supabase_vault (PSQL-1387)#2273
Merged
Conversation
hitmands
approved these changes
Jul 15, 2026
samrose
force-pushed
the
sam/psql-1387-wrappers-vault-guard
branch
from
July 15, 2026 12:59
71520d9 to
bdb0c3a
Compare
mmlb
force-pushed
the
sam/psql-1387-wrappers-vault-guard
branch
2 times, most recently
from
July 23, 2026 19:06
bb138dd to
73c1427
Compare
Going to be used in the next commit for a regression test.
mmlb
force-pushed
the
sam/psql-1387-wrappers-vault-guard
branch
from
July 23, 2026 19:10
73c1427 to
5a26d6a
Compare
PostgreSQL Extension Dependency Analysis: PR #2273
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2273
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
…ault absent A customer project hit a failing upgrade. Initial RCA indicates that execute_wrappers_patch assumes that if the wrappers extension exists, then vault.secrets must also exist. This test replicates that setup and as such verifies that it fails.
`execute_wrappers_patch` loops foreign servers and references vault.secrets, but was only gated on the wrappers extension. A project with wrappers and a foreign server but no supabase_vault extension enabled hits `relation "vault.secrets" does notexist error which aborts the pg_upgrade and forces a rollback due to `run_sql` returning an error which trips the `set -e` early in the script. `run_sql` returns an error even though theres no `-v ON_ERROR_STOP` because its executing a single statement will use the return/exit status of the last statement as its exit code (this is same thing that bash does by default, ignores errors within script and uses return status of last statement as its return). Fixes PSQL-1387
mmlb
force-pushed
the
sam/psql-1387-wrappers-vault-guard
branch
from
July 23, 2026 20:08
5a26d6a to
f1501a2
Compare
mmlb
enabled auto-merge
July 23, 2026 20:08
Merged
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.
execute_wrappers_patchloops foreign servers and references vault.secrets, but was only gated on the wrappers extension. A project with wrappers and a foreign server but no supabase_vault extension enabled hitserror which aborts the pg_upgrade and forces a rollback due to
run_sqlreturning an error which trips theset -eearly in the script.run_sqlreturns an error even though theres no-v ON_ERROR_STOPbecause its executing a single statement will use the return/exit status of the last statement as its exit code (this is same thing that bash does by default, ignores errors within script and uses return status of last statement as its return).