supabase-postgres.git / summary / log / commit / refs
commit ebaf44357e0cac55eecff8cbbb19d6f62ded0e3e
Author: samrose <samuel@supabase.io>
Commit: GitHub <noreply@github.com>
Date: Wed May 21 17:48:16 2025 +0000
feat: covering ranges for upgrades (#1603)
* feat: need to cover less than or equal to 15
* feat: handle range of 16 or greater for destination of upgrade
* feat: use -ge approach for all instances of 16+ handling
* chore: testing vers bump
* chore: version bump for release
.../files/admin_api_scripts/pg_upgrade_scripts/initiate.sh | 14 +++++++-------
ansible/vars.yml | 6 +++---
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
index 18850883..e5c4ddbf 100755
--- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
+++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
@@ -43,8 +43,8 @@ POST_UPGRADE_EXTENSION_SCRIPT="/tmp/pg_upgrade/pg_upgrade_extensions.sql"
POST_UPGRADE_POSTGRES_PERMS_SCRIPT="/tmp/pg_upgrade/pg_upgrade_postgres_perms.sql"
OLD_PGVERSION=$(run_sql -A -t -c "SHOW server_version;")
-# Skip locale settings if both versions are PostgreSQL 17+
-if ! [[ "$OLD_PGVERSION" =~ ^17.* && "$PGVERSION" =~ ^17.* ]]; then
+# Skip locale settings if both versions are PostgreSQL 16+
+if ! [[ "${OLD_PGVERSION%%.*}" -ge 16 && "${PGVERSION%%.*}" -ge 16 ]]; then
SERVER_LC_COLLATE=$(run_sql -A -t -c "SHOW lc_collate;")
SERVER_LC_CTYPE=$(run_sql -A -t -c "SHOW lc_ctype;")
fi
@@ -403,7 +403,7 @@ function initiate_upgrade {
rm -rf "${PGDATANEW:?}/"
if [ "$IS_NIX_UPGRADE" = "true" ]; then
- if [[ "$PGVERSION" =~ ^17.* ]]; then
+ if [[ "${PGVERSION%%.*}" -ge 16 ]]; then
LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW/initdb --encoding=$SERVER_ENCODING --locale-provider=icu --icu-locale=en_US.UTF-8 -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres
else
LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW/initdb --encoding=$SERVER_ENCODING --lc-collate=$SERVER_LC_COLLATE --lc-ctype=$SERVER_LC_CTYPE -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres
@@ -430,8 +430,8 @@ $(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf
# Add the setting if not found
echo "max_slot_wal_keep_size = -1" >> "$TMP_CONFIG"
- # Remove db_user_namespace if upgrading from PG15
- if [[ "$OLD_PGVERSION" =~ ^15.* && "$PGVERSION" =~ ^17.* ]]; then
+ # Remove db_user_namespace if upgrading from PG15 or lower to PG16+
+ if [[ "${OLD_PGVERSION%%.*}" -le 15 && "${PGVERSION%%.*}" -ge 16 ]]; then
sed -i '/^db_user_namespace/d' "$TMP_CONFIG"
fi
@@ -457,7 +457,7 @@ EOF
UPGRADE_COMMAND=". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $UPGRADE_COMMAND"
fi
- if [[ "$PGVERSION" =~ ^17.* ]]; then
+ if [[ "${PGVERSION%%.*}" -ge 16 ]]; then
GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres
else
GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres
@@ -479,7 +479,7 @@ EOF
fi
# Start the old PostgreSQL instance with version-specific options
- if [[ "$PGVERSION" =~ ^17.* ]]; then
+ if [[ "${PGVERSION%%.*}" -ge 16 ]]; then
GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres
else
GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres
diff --git a/ansible/vars.yml b/ansible/vars.yml
index 87233533..c33f69a7 100644
--- a/ansible/vars.yml
+++ b/ansible/vars.yml
@@ -9,9 +9,9 @@ postgres_major:
# Full version strings for each major version
postgres_release:
- postgresorioledb-17: "17.0.1.085-orioledb"
- postgres17: "17.4.1.035"
- postgres15: "15.8.1.092"
+ postgresorioledb-17: "17.0.1.086-orioledb"
+ postgres17: "17.4.1.036"
+ postgres15: "15.8.1.093"
# Non Postgres Extensions
pgbouncer_release: "1.19.0"
[parent: 413a82d9bc70]