diff --git a/ansible/vars.yml b/ansible/vars.yml index d0251b3dc..019f19279 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -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" diff --git a/flake.nix b/flake.nix index f3564df71..519e89567 100644 --- a/flake.nix +++ b/flake.nix @@ -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 diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql index 3d71bb176..71b6ab06a 100644 --- a/migrations/db/init-scripts/00000000000000-initial-schema.sql +++ b/migrations/db/init-scripts/00000000000000-initial-schema.sql @@ -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 $$; diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 56390f882..5a38517ba 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -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; $_$; diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index ed8480733..f120b1b27 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -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; $_$; diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 482cefe88..8c5d32c39 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -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; $_$; diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 918ba3d81..84545145e 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -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 $$; diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index d914c5aec..8fa266fce 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -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