Skip to content

Commit fcb876d

Browse files
authored
feat: do not enable pgjwt by default in pg 15 (#1592)
1 parent d7fffb3 commit fcb876d

File tree

9 files changed

+23
-50
lines changed

9 files changed

+23
-50
lines changed

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
- name: Check if psql_version is psql_17
1414
set_fact:
1515
is_psql_17: "{{ psql_version in ['psql_17'] }}"
16+
17+
- name: Check if psql_version is psql_15
18+
set_fact:
19+
is_psql_15: "{{ psql_version in ['psql_15'] }}"
1620

1721
- name: Remove specified extensions from postgresql.conf if orioledb-17 or 17 build
1822
ansible.builtin.command:
@@ -25,7 +29,7 @@
2529
- name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build
2630
ansible.builtin.command:
2731
cmd: >
28-
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g'
32+
sed -i 's/ timescaledb,//g; s/ plv8,//g'
2933
/etc/postgresql-custom/supautils.conf
3034
when: is_psql_oriole or is_psql_17 and stage2_nix
3135
become: yes

ansible/vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ postgres_major:
99

1010
# Full version strings for each major version
1111
postgres_release:
12-
postgresorioledb-17: "17.0.1.080-orioledb"
13-
postgres17: "17.4.1.030"
14-
postgres15: "15.8.1.087"
12+
postgresorioledb-17: "17.0.1.081-orioledb"
13+
postgres17: "17.4.1.031"
14+
postgres15: "15.8.1.088"
1515

1616
# Non Postgres Extensions
1717
pgbouncer_release: "1.19.0"

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

migrations/schema-15.sql

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,6 @@ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions;
114114
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
115115

116116

117-
--
118-
-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: -
119-
--
120-
121-
CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions;
122-
123-
124-
--
125-
-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: -
126-
--
127-
128-
COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql';
129-
130-
131117
--
132118
-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: -
133119
--

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)