Skip to content

feat: keep pgjwt present but deactivated for orioledb only to avoid r… #1557

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
merged 6 commits into from
Apr 23, 2025
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
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.0.1.067-orioledb"
postgres17: "17.4.1.017"
postgres15: "15.8.1.074"
postgresorioledb-17: "17.0.1.068-orioledb"
postgres17: "17.4.1.018"
postgres15: "15.8.1.075"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
Expand Down
8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,14 @@
x:
x != ./nix/ext/timescaledb.nix &&
x != ./nix/ext/timescaledb-2.9.1.nix &&
x != ./nix/ext/plv8.nix &&
x != ./nix/ext/pgjwt.nix
x != ./nix/ext/plv8.nix
) ourExtensions;

orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ];
dbExtensions17 = orioleFilteredExtensions;
dbExtensions17 = builtins.filter (
x:
x != ./nix/ext/pgjwt.nix
) orioleFilteredExtensions;
getPostgresqlPackage = version:
pkgs.postgresql."postgresql_${version}";
# Create a 'receipt' file for a given postgresql package. This is a way
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ do $$
begin
if exists (select 1 from pg_available_extensions where name = 'pgjwt') then
if not exists (select 1 from pg_extension where extname = 'pgjwt') then
create extension if not exists pgjwt with schema "extensions" cascade;
if current_setting('server_version_num')::int / 10000 = 15 then
create extension if not exists pgjwt with schema "extensions" cascade;
end if;
end if;
end if;
end $$;
Expand Down
14 changes: 7 additions & 7 deletions migrations/schema-15.sql
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ begin
raise debug 'PgBouncer auth request: %', p_usename;

return query
select
rolname::text,
case when rolvaliduntil < now()
then null
else rolpassword::text
end
from pg_authid
select
rolname::text,
case when rolvaliduntil < now()
then null
else rolpassword::text
end
from pg_authid
where rolname=$1 and rolcanlogin;
end;
$_$;
Expand Down
14 changes: 7 additions & 7 deletions migrations/schema-17.sql
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@ begin
raise debug 'PgBouncer auth request: %', p_usename;

return query
select
rolname::text,
case when rolvaliduntil < now()
then null
else rolpassword::text
end
from pg_authid
select
rolname::text,
case when rolvaliduntil < now()
then null
else rolpassword::text
end
from pg_authid
where rolname=$1 and rolcanlogin;
end;
$_$;
Expand Down
14 changes: 7 additions & 7 deletions migrations/schema-orioledb-17.sql
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,13 @@ begin
raise debug 'PgBouncer auth request: %', p_usename;

return query
select
rolname::text,
case when rolvaliduntil < now()
then null
else rolpassword::text
end
from pg_authid
select
rolname::text,
case when rolvaliduntil < now()
then null
else rolpassword::text
end
from pg_authid
where rolname=$1 and rolcanlogin;
end;
$_$;
Expand Down
4 changes: 3 additions & 1 deletion nix/tests/prime.sql
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ do $$
begin
if exists (select 1 from pg_available_extensions where name = 'pgjwt') then
if not exists (select 1 from pg_extension where extname = 'pgjwt') then
create extension if not exists pgjwt;
if current_setting('server_version_num')::int / 10000 = 15 then
create extension if not exists pgjwt;
end if;
end if;
end if;
end $$;
Expand Down
12 changes: 0 additions & 12 deletions nix/tools/dbmate-tool.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,6 @@ check_orioledb_ready() {
return 1
}

trim_schema() {
case "$CURRENT_SYSTEM" in
"x86_64-darwin"|"aarch64-darwin")
sed -i '' '/INSERT INTO public.schema_migrations/,$d' "./db/schema.sql"
echo "Matched: $CURRENT_SYSTEM"
;;
*)
sed -i '/INSERT INTO public.schema_migrations/,$d' "./db/schema.sql"
;;
esac
}

perform_dump() {
local max_attempts=3
local attempt=1
Expand Down
Loading