Skip to content

Commit 34840be

Browse files
authored
feat: update minor versions of pg 17 and 15 (#1766)
* feat: update minor versions of pg 17 and 15 due to https://www.postgresql.org/about/news/postgresql-176-1610-1514-1419-1322-and-18-beta-3-released-3118/ * fix: update input hash on each version * fix: update schemas used for testing * fix: new minor version introduces --restrict-key which we will set with arbitrary value ONLY IN TESTING context No one should EVER use the schemas in our repo for restoration of production databases! * chore: bump version for release
1 parent 829ef41 commit 34840be

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed

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.5.1.021-orioledb"
13-
postgres17: "17.4.1.078"
14-
postgres15: "15.8.1.135"
12+
postgresorioledb-17: "17.5.1.018-orioledb"
13+
postgres17: "17.6.1.000"
14+
postgres15: "15.14.1.000"
1515

1616
# Non Postgres Extensions
1717
pgbouncer_release: "1.19.0"

migrations/schema-15.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
-- PostgreSQL database dump
33
--
44

5-
-- Dumped from database version 15.8
6-
-- Dumped by pg_dump version 15.8
5+
\restrict SupabaseTestDumpKey123
6+
7+
-- Dumped from database version 15.14
8+
-- Dumped by pg_dump version 15.14
79

810
SET statement_timeout = 0;
911
SET lock_timeout = 0;
@@ -997,3 +999,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
997999
-- PostgreSQL database dump complete
9981000
--
9991001

1002+
\unrestrict SupabaseTestDumpKey123
1003+

migrations/schema-17.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
-- PostgreSQL database dump
33
--
44

5-
-- Dumped from database version 17.4
6-
-- Dumped by pg_dump version 17.4
5+
\restrict SupabaseTestDumpKey123
6+
7+
-- Dumped from database version 17.6
8+
-- Dumped by pg_dump version 17.6
79

810
SET statement_timeout = 0;
911
SET lock_timeout = 0;
@@ -998,3 +1000,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
9981000
-- PostgreSQL database dump complete
9991001
--
10001002

1003+
\unrestrict SupabaseTestDumpKey123
1004+

nix/config.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ in
4242
supportedPostgresVersions = {
4343
postgres = {
4444
"15" = {
45-
version = "15.8";
46-
hash = "sha256-RANRX5pp7rPv68mPMLjGlhIr/fiV6Ss7I/W452nty2o=";
45+
version = "15.14";
46+
hash = "sha256-Bt110wXNOHDuYrOTLmYcYkVD6vmuK6N83sCk+O3QUdI=";
4747
};
4848
"17" = {
49-
version = "17.4";
50-
hash = "sha256-xGBbc/6hGWNAZpn5Sblm5dFzp+4Myu+JON7AyoqZX+c=";
49+
version = "17.6";
50+
hash = "sha256-4GMKNgCuonURcVVjJZ7CERzV9DU6SwQOC+gn+UzXqLA=";
5151
};
5252
};
5353
orioledb = {

nix/tools/dbmate-tool.sh.in

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,21 @@ perform_dump() {
177177
while [ $attempt -le $max_attempts ]; do
178178
echo "Attempting pg_dump (attempt $attempt/$max_attempts)"
179179

180-
if "${PSQLBIN}/pg_dump" -h localhost -p "$PORTNO" -U "$PGSQL_SUPERUSER" -d postgres --schema-only --no-owner --no-privileges > "./db/schema.sql"; then
180+
# Build the dump command
181+
local dump_cmd="${PSQLBIN}/pg_dump -h localhost -p $PORTNO -U $PGSQL_SUPERUSER -d postgres --schema-only --no-owner --no-privileges"
182+
183+
# Only use --restrict-key for standard PostgreSQL 15 and 17 versions
184+
# OrioleDB doesn't support this flag yet
185+
if [ "$PSQL_VERSION" = "15" ] || [ "$PSQL_VERSION" = "17" ]; then
186+
# Use a fixed restrict key for reproducible test dumps
187+
# This is safe in testing contexts but should not be used in production
188+
dump_cmd="$dump_cmd --restrict-key=SupabaseTestDumpKey123"
189+
echo "Using --restrict-key for reproducible dumps (PostgreSQL $PSQL_VERSION)"
190+
else
191+
echo "Skipping --restrict-key (version: $PSQL_VERSION)"
192+
fi
193+
194+
if $dump_cmd > "./db/schema.sql"; then
181195
return 0
182196
fi
183197

@@ -257,7 +271,6 @@ EOSQL
257271

258272
echo "CURRENT_SYSTEM: $CURRENT_SYSTEM"
259273
if [ -f "./db/schema.sql" ]; then
260-
trim_schema
261274
cp "./db/schema.sql" "./migrations/schema-$PSQL_VERSION.sql"
262275
echo "Schema file moved to ./migrations/schema-$PSQL_VERSION.sql"
263276
echo "PSQLBIN is $PSQLBIN"

0 commit comments

Comments
 (0)