Skip to content

Commit 8f4a047

Browse files
committed
feat: restore TimescaleDB extension support for PostgreSQL 17
restores TimescaleDB support for PostgreSQL 17 by: 1. Adding TimescaleDB 2.23.0 to versions.json with PG 15 & 17 support 2. Removing timescaledb from filtered extensions list for PG 17 3. Removing sed commands that stripped timescaledb from Dockerfile-17 4. Updating migration test to support PG versions up to 18 5. Keeping timescaledb in shared_preload_libraries (postgresql.conf.j2) TimescaleDB 2.23.0 is the first version to officially support PostgreSQL 17. Previously filtered in PR supabase#1321, now restored following contribution guidelines.
1 parent ab99074 commit 8f4a047

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Dockerfile-17

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,9 @@ RUN sed -i \
202202
chown postgres:postgres /etc/postgresql-custom
203203

204204
# Remove items from postgresql.conf
205-
RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf"
206205
#as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present
207-
RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf"
208-
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/supautils.conf"
206+
RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf"
207+
RUN sed -i 's/ plv8,//g' "/etc/postgresql-custom/supautils.conf"
209208

210209

211210

migrations/tests/extensions/10-timescaledb.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
begin;
22
do $_$
33
begin
4-
if current_setting('server_version_num')::integer >= 150000 and current_setting('server_version_num')::integer < 160000 then
4+
if current_setting('server_version_num')::integer >= 150000 and current_setting('server_version_num')::integer < 180000 then
55
create extension if not exists timescaledb with schema "extensions";
66
end if;
77
end

nix/ext/versions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,13 @@
519519
"15"
520520
],
521521
"hash": "sha256-sLxWdBmih9mgiO51zLLxn9uwJVYc5JVHJjSWoADoJ+w="
522+
},
523+
"2.23.0": {
524+
"postgresql": [
525+
"15",
526+
"17"
527+
],
528+
"hash": "sha256-f965840ef9ba969b874c5825ca9a1e8cca667783d7c8bab623ffacb8d95b2d68"
522529
}
523530
},
524531
"vector": {

nix/packages/postgres.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@
4747

4848
#Where we import and build the orioledb extension, we add on our custom extensions
4949
# plus the orioledb option
50-
#we're not using timescaledb or plv8 in the orioledb-17 version or pg 17 of supabase extensions
50+
#we're not using timescaledb or plv8 in the orioledb-17 version
5151
orioleFilteredExtensions = builtins.filter (
5252
x: x != ../ext/timescaledb.nix && x != ../ext/timescaledb-2.9.1.nix && x != ../ext/plv8
5353
) ourExtensions;
5454

5555
orioledbExtensions = orioleFilteredExtensions ++ [ ../ext/orioledb.nix ];
56-
dbExtensions17 = orioleFilteredExtensions;
56+
# pg 17 of supabase extensions - only filter out plv8
57+
dbExtensions17 = builtins.filter (x: x != ../ext/plv8) ourExtensions;
5758
getPostgresqlPackage = version: pkgs."postgresql_${version}";
5859
# Create a 'receipt' file for a given postgresql package. This is a way
5960
# of adding a bit of metadata to the package, which can be used by other

0 commit comments

Comments
 (0)