Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
pg: [15]
pg: [15, 17]

steps:
- name: Start PostgreSQL ${{ matrix.pg }}
Expand All @@ -21,13 +21,13 @@ jobs:
- name: Install build-dependencies
run: apt-get install -y liblz4-dev libreadline-dev zlib1g-dev libzstd-dev

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: checkout hypopg
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'HypoPG/hypopg'
ref: 'debian/1.3.1-2'
ref: '1.4.3'

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Contributor Author

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

path: ./hypopg

- name: Create tests directory
Expand All @@ -52,7 +52,7 @@ jobs:
if: ${{ failure() }}
run: cat regress/regression.diffs

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: regression.out
Expand Down
File renamed without changes.
159 changes: 0 additions & 159 deletions index_advisor--0.1.1.sql

This file was deleted.

4 changes: 3 additions & 1 deletion index_advisor--0.2.0.sql → index_advisor--0.1.2--0.2.0.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
create or replace function index_advisor(
drop function index_advisor(text);
Comment thread
utkarash2991 marked this conversation as resolved.
Resolved

create function index_advisor(
query text
)
returns table (
Expand Down
15 changes: 15 additions & 0 deletions test/expected/create_extension_default_version.out
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;
29 changes: 29 additions & 0 deletions test/expected/upgrade_from_oldest_version.out
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;
12 changes: 12 additions & 0 deletions test/sql/create_extension_default_version.sql
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;
24 changes: 24 additions & 0 deletions test/sql/upgrade_from_oldest_version.sql
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;
Loading