diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 99b89d6d9..d3209fc04 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -13,6 +13,10 @@ - name: Check if psql_version is psql_17 set_fact: is_psql_17: "{{ psql_version in ['psql_17'] }}" + + - name: Check if psql_version is psql_15 + set_fact: + is_psql_15: "{{ psql_version in ['psql_15'] }}" - name: Remove specified extensions from postgresql.conf if orioledb-17 or 17 build ansible.builtin.command: @@ -25,7 +29,7 @@ - name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build ansible.builtin.command: cmd: > - sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g' + sed -i 's/ timescaledb,//g; s/ plv8,//g' /etc/postgresql-custom/supautils.conf when: is_psql_oriole or is_psql_17 and stage2_nix become: yes diff --git a/ansible/vars.yml b/ansible/vars.yml index 50c6662ce..5a0eca3ec 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.080-orioledb" - postgres17: "17.4.1.030" - postgres15: "15.8.1.087" + postgresorioledb-17: "17.0.1.081-orioledb" + postgres17: "17.4.1.031" + postgres15: "15.8.1.088" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql index 71b6ab06a..272c989c0 100644 --- a/migrations/db/init-scripts/00000000000000-initial-schema.sql +++ b/migrations/db/init-scripts/00000000000000-initial-schema.sql @@ -18,16 +18,6 @@ grant pg_read_all_data to supabase_read_only_user; create schema if not exists extensions; create extension if not exists "uuid-ossp" with schema extensions; create extension if not exists pgcrypto with schema extensions; -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 - 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 $$; -- Set up auth roles for the developer diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 5a38517ba..00e62c8eb 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -114,20 +114,6 @@ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; --- --- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; - - --- --- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; - - -- -- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - -- diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 566da6aed..540bee2e8 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -30,8 +30,9 @@ order by name ----------------- pg_cron + pgjwt tsm_system_time -(2 rows) +(3 rows) /* @@ -94,7 +95,6 @@ order by pg_walinspect | t pgaudit | t pgcrypto | t - pgjwt | f pgmq | f pgroonga | f pgroonga_database | f @@ -128,7 +128,7 @@ order by vector | t wrappers | f xml2 | f -(80 rows) +(79 rows) /* @@ -1316,12 +1316,6 @@ order by pgcrypto | extensions | pgp_sym_encrypt | text, text, text | bytea pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text | bytea pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea - pgjwt | extensions | algorithm_sign | signables text, secret text, algorithm text | text - pgjwt | extensions | sign | payload json, secret text, algorithm text | text - pgjwt | extensions | try_cast_double | inp text | double precision - pgjwt | extensions | url_decode | data text | bytea - pgjwt | extensions | url_encode | data bytea | text - pgjwt | extensions | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean pgmq | pgmq | _ensure_pg_partman_installed | | void pgmq | pgmq | _get_partition_col | partition_interval text | text @@ -5227,7 +5221,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5057 rows) +(5051 rows) /* diff --git a/nix/tests/expected/z_15_pgjwt.out b/nix/tests/expected/z_15_pgjwt.out index 4e4500fd4..8ccdce1d1 100644 --- a/nix/tests/expected/z_15_pgjwt.out +++ b/nix/tests/expected/z_15_pgjwt.out @@ -1,3 +1,7 @@ +-- Install pgjwt in extensions schema +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; +-- Set search path to include extensions schema +SET search_path TO extensions, public; select sign( payload := '{"sub":"1234567890","name":"John Doe","iat":1516239022}', diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 84545145e..fb724847f 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -57,16 +57,6 @@ create extension if not exists pg_walinspect; create extension if not exists pgaudit; create extension if not exists pgcrypto; create extension if not exists pgtap; -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 - if current_setting('server_version_num')::int / 10000 = 15 then - create extension if not exists pgjwt; - end if; - end if; - end if; -end $$; create extension if not exists pgroonga; create extension if not exists pgroonga_database; create extension if not exists pgsodium; diff --git a/nix/tests/sql/z_15_pgjwt.sql b/nix/tests/sql/z_15_pgjwt.sql index 24179e7a0..d6b488635 100644 --- a/nix/tests/sql/z_15_pgjwt.sql +++ b/nix/tests/sql/z_15_pgjwt.sql @@ -1,3 +1,9 @@ +-- Install pgjwt in extensions schema +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; + +-- Set search path to include extensions schema +SET search_path TO extensions, public; + select sign( payload := '{"sub":"1234567890","name":"John Doe","iat":1516239022}', diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 227e1b7be..a1e289d66 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -267,13 +267,12 @@ orioledb_config_items() { echo "non-macos pg 17 conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/supautils.conf" elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" perl -pi -e 's/ plv8,//g;' "$DATDIR/supautils.conf" - perl -pi -e 's/ pgjwt,//g;' "$DATDIR/supautils.conf" fi }