Repository navigation
Force CREATE EXTENSION through the upgrade chain + fix CI + add PG17 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
utkarash2991
merged 3 commits into
supabase:main
from
utkarash2991:utkarashsingh/psqlext-1773-force-upgrade-chain
Oct 6, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| begin; | ||
| -- Unversioned CREATE EXTENSION must resolve through the full upgrade | ||
| -- chain (0.1.0 -> 0.1.1 -> 0.1.2 -> default_version), since only 0.1.0 | ||
| -- exists as a standalone install script - everything after that is only | ||
| -- reachable via incremental upgrade scripts. Confirms the chain is | ||
| -- unbroken end to end, not just reachable via an explicit version pin. | ||
| create extension index_advisor cascade; | ||
| NOTICE: installing required extension "hypopg" | ||
| select extversion from pg_extension where extname = 'index_advisor'; | ||
| extversion | ||
| ------------ | ||
| 0.2.0 | ||
| (1 row) | ||
|
|
||
| rollback; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| begin; | ||
| -- Simulates a project that installed index_advisor at its very first | ||
| -- version and later runs ALTER EXTENSION ... UPDATE (e.g. during a | ||
| -- Postgres major-version upgrade, or a manual extension update) - | ||
| -- exercises the full 0.1.0 -> 0.1.1 -> 0.1.2 -> default_version upgrade | ||
| -- chain end to end, including the 0.1.2->default_version return-type | ||
| -- change (drop + recreate), not just a fresh install pinned at one | ||
| -- version. | ||
| create extension index_advisor version '0.1.0' cascade; | ||
| NOTICE: installing required extension "hypopg" | ||
| alter extension index_advisor update; | ||
| select extversion from pg_extension where extname = 'index_advisor'; | ||
| extversion | ||
| ------------ | ||
| 0.2.0 | ||
| (1 row) | ||
|
|
||
| create table public.book( | ||
| id int | ||
| ); | ||
| select index_advisor($$ | ||
| select * from book where id = $1 | ||
| $$); | ||
| index_advisor | ||
| --------------------------------------------------------------------------------- | ||
| (0.00,4.13,41.88,14.83,"{""CREATE INDEX ON public.book USING btree (id)""}",{}) | ||
| (1 row) | ||
|
|
||
| rollback; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| begin; | ||
|
|
||
| -- Unversioned CREATE EXTENSION must resolve through the full upgrade | ||
| -- chain (0.1.0 -> 0.1.1 -> 0.1.2 -> default_version), since only 0.1.0 | ||
| -- exists as a standalone install script - everything after that is only | ||
| -- reachable via incremental upgrade scripts. Confirms the chain is | ||
| -- unbroken end to end, not just reachable via an explicit version pin. | ||
| create extension index_advisor cascade; | ||
|
|
||
| select extversion from pg_extension where extname = 'index_advisor'; | ||
|
|
||
| rollback; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| begin; | ||
|
|
||
| -- Simulates a project that installed index_advisor at its very first | ||
| -- version and later runs ALTER EXTENSION ... UPDATE (e.g. during a | ||
| -- Postgres major-version upgrade, or a manual extension update) - | ||
| -- exercises the full 0.1.0 -> 0.1.1 -> 0.1.2 -> default_version upgrade | ||
| -- chain end to end, including the 0.1.2->default_version return-type | ||
| -- change (drop + recreate), not just a fresh install pinned at one | ||
| -- version. | ||
| create extension index_advisor version '0.1.0' cascade; | ||
|
|
||
| alter extension index_advisor update; | ||
|
|
||
| select extversion from pg_extension where extname = 'index_advisor'; | ||
|
|
||
| create table public.book( | ||
| id int | ||
| ); | ||
|
|
||
| select index_advisor($$ | ||
| select * from book where id = $1 | ||
| $$); | ||
|
|
||
| rollback; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to keep these in a different PR as they are totally independent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah ideally it should be in different PRs. Will be keeping in mind next time