Skip to content

Commit a3c9a2b

Browse files
committed
fix: available, but not enabled pgjwt fixes (should still be controlled by supautils in all versions)
1 parent 6b19e6b commit a3c9a2b

File tree

7 files changed

+16
-41
lines changed

7 files changed

+16
-41
lines changed

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,11 @@
2929
- name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build
3030
ansible.builtin.command:
3131
cmd: >
32-
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g'
32+
sed -i 's/ timescaledb,//g; s/ plv8,//g'
3333
/etc/postgresql-custom/supautils.conf
3434
when: is_psql_oriole or is_psql_17 and stage2_nix
3535
become: yes
3636

37-
- name: Remove pgjwt from supautils.conf if 15 build
38-
ansible.builtin.command:
39-
cmd: >
40-
sed -i 's/ pgjwt,//g'
41-
/etc/postgresql-custom/supautils.conf
42-
when: is_psql_15 and stage2_nix
43-
become: yes
44-
4537
- name: Remove db_user_namespace from postgresql.conf if orioledb-17 or 17 build
4638
ansible.builtin.command:
4739
cmd: >

migrations/db/init-scripts/00000000000000-initial-schema.sql

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ grant pg_read_all_data to supabase_read_only_user;
1818
create schema if not exists extensions;
1919
create extension if not exists "uuid-ossp" with schema extensions;
2020
create extension if not exists pgcrypto with schema extensions;
21-
do $$
22-
begin
23-
if exists (select 1 from pg_available_extensions where name = 'pgjwt') then
24-
if not exists (select 1 from pg_extension where extname = 'pgjwt') then
25-
if current_setting('server_version_num')::int / 10000 = 15 then
26-
create extension if not exists pgjwt with schema "extensions" cascade;
27-
end if;
28-
end if;
29-
end if;
30-
end $$;
3121

3222

3323
-- Set up auth roles for the developer

nix/tests/expected/z_15_ext_interface.out

Lines changed: 4 additions & 10 deletions
Large diffs are not rendered by default.

nix/tests/expected/z_15_pgjwt.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
-- Install pgjwt in extensions schema
2+
CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions;
3+
-- Set search path to include extensions schema
4+
SET search_path TO extensions, public;
15
select
26
sign(
37
payload := '{"sub":"1234567890","name":"John Doe","iat":1516239022}',

nix/tests/prime.sql

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,6 @@ create extension if not exists pg_walinspect;
5757
create extension if not exists pgaudit;
5858
create extension if not exists pgcrypto;
5959
create extension if not exists pgtap;
60-
do $$
61-
begin
62-
if exists (select 1 from pg_available_extensions where name = 'pgjwt') then
63-
if not exists (select 1 from pg_extension where extname = 'pgjwt') then
64-
if current_setting('server_version_num')::int / 10000 = 15 then
65-
create extension if not exists pgjwt;
66-
end if;
67-
end if;
68-
end if;
69-
end $$;
7060
create extension if not exists pgroonga;
7161
create extension if not exists pgroonga_database;
7262
create extension if not exists pgsodium;

nix/tests/sql/z_15_pgjwt.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-- Install pgjwt in extensions schema
2+
CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions;
3+
4+
-- Set search path to include extensions schema
5+
SET search_path TO extensions, public;
6+
17
select
28
sign(
39
payload := '{"sub":"1234567890","name":"John Doe","iat":1516239022}',

nix/tools/run-server.sh.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,12 @@ orioledb_config_items() {
267267
echo "non-macos pg 17 conf"
268268
sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"
269269
sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
270-
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf"
270+
sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/supautils.conf"
271271
elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then
272272
perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
273273
perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf"
274274
perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf"
275275
perl -pi -e 's/ plv8,//g;' "$DATDIR/supautils.conf"
276-
perl -pi -e 's/ pgjwt,//g;' "$DATDIR/supautils.conf"
277276
fi
278277
}
279278

0 commit comments

Comments
 (0)