Skip to content

Commit e56815e

Browse files
committed
chore: remove pgjwt except for in pg 15.x
1 parent bef2c9c commit e56815e

16 files changed

+4843
-4884
lines changed

Dockerfile-15

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ ARG pgrouting_release=3.4.1
1010
ARG pgtap_release=1.2.0
1111
ARG pg_cron_release=1.6.2
1212
ARG pgaudit_release=1.7.0
13-
ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9
1413
ARG pgsql_http_release=1.5.0
1514
ARG plpgsql_check_release=2.2.5
1615
ARG pg_safeupdate_release=1.4

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to
44

55
## Primary Features
66
- ✅ Postgres [postgresql-15.8](https://www.postgresql.org/docs/15/index.html)
7+
- ✅ Postgres [postgresql-17.4](https://www.postgresql.org/docs/17/index.html)
78
- ✅ Postgres [orioledb-postgresql-17_5](https://github.com/orioledb/orioledb)
89
- ✅ Ubuntu 20.04 (Focal Fossa).
910
-[wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication.
@@ -44,6 +45,38 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to
4445
| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL |
4546
| [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction |
4647

48+
### PostgreSQL 17 Extensions
49+
| Extension | Version | Description |
50+
| ------------- | :-------------: | ------------- |
51+
| [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL |
52+
| [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL |
53+
| [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE |
54+
| [pg_backtrace](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | [1.1](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | Updated fork of pg_backtrace |
55+
| [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL |
56+
| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL |
57+
| [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL |
58+
| [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL |
59+
| [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres |
60+
| [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | [5081a7b5cb890876e67d8e7486b6a64c38c9a492](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | Filter PostgreSQL statements by execution plans |
61+
| [pg_repack](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | [1.5.2](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | Reorganize tables in PostgreSQL databases with minimal locks |
62+
| [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL |
63+
| [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL |
64+
| [pgaudit](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | [17.0](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | Open Source PostgreSQL Audit Logging |
65+
| [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. |
66+
| [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index |
67+
| [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality |
68+
| [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL |
69+
| [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres |
70+
| [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL |
71+
| [pgvector](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | [0.8.0](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | Open-source vector similarity search for Postgres |
72+
| [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL |
73+
| [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL |
74+
| [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL |
75+
| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | [0.4.4](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL |
76+
| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security |
77+
| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL |
78+
| [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction |
79+
4780
### PostgreSQL orioledb-17 Extensions
4881
| Extension | Version | Description |
4982
| ------------- | :-------------: | ------------- |
@@ -61,7 +94,6 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to
6194
| [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL |
6295
| [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL |
6396
| [pgaudit](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | [17.0](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | Open Source PostgreSQL Audit Logging |
64-
| [pgjwt](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | [9742dab1b2f297ad3811120db7b21451bca2d3c9](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | PostgreSQL implementation of JSON Web Tokens |
6597
| [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. |
6698
| [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index |
6799
| [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality |

ansible/tasks/setup-extensions.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build
2626
ansible.builtin.command:
2727
cmd: >
28-
sed -i 's/ timescaledb,//g; s/ plv8,//g'
28+
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g'
2929
/etc/postgresql-custom/supautils.conf
3030
when: is_psql_oriole or is_psql_17 and stage2_nix
3131
become: yes

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@
154154
x:
155155
x != ./nix/ext/timescaledb.nix &&
156156
x != ./nix/ext/timescaledb-2.9.1.nix &&
157-
x != ./nix/ext/plv8.nix
157+
x != ./nix/ext/plv8.nix &&
158+
x != ./nix/ext/pgjwt.nix
158159
) ourExtensions;
159160

160161
orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ];

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ 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-
create extension if not exists pgjwt 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+
create extension if not exists pgjwt with schema "extensions" cascade;
26+
end if;
27+
end if;
28+
end $$;
29+
2230

2331
-- Set up auth roles for the developer
2432
create role anon nologin noinherit;

migrations/schema-17.sql

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,6 @@ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions;
129129
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
130130

131131

132-
--
133-
-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: -
134-
--
135-
136-
CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions;
137-
138-
139-
--
140-
-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: -
141-
--
142-
143-
COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql';
144-
145-
146132
--
147133
-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: -
148134
--
@@ -340,17 +326,25 @@ BEGIN
340326

341327
GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;
342328

343-
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
344-
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
329+
IF EXISTS (
330+
SELECT FROM pg_extension
331+
WHERE extname = 'pg_net'
332+
-- all versions in use on existing projects as of 2025-02-20
333+
-- version 0.12.0 onwards don't need these applied
334+
AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0')
335+
) THEN
336+
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
337+
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
345338

346-
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
347-
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
339+
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
340+
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
348341

349-
REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
350-
REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
342+
REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
343+
REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
351344

352-
GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
353-
GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
345+
GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
346+
GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
347+
END IF;
354348
END IF;
355349
END;
356350
$$;

migrations/schema-orioledb-17.sql

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

124124

125-
--
126-
-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: -
127-
--
128-
129-
CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions;
130-
131-
132-
--
133-
-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: -
134-
--
135-
136-
COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql';
137-
138-
139125
--
140126
-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: -
141127
--
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
BEGIN;
2-
create extension if not exists pgjwt with schema "extensions" cascade;
2+
do $$
3+
begin
4+
if exists (select 1 from pg_available_extensions where name = 'pgjwt') then
5+
if not exists (select 1 from pg_extension where extname = 'pgjwt') then
6+
create extension if not exists pgjwt with schema "extensions" cascade;
7+
end if;
8+
end if;
9+
end $$;
310
ROLLBACK;

nix/tests/expected/pgjwt.out

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)