Skip to content

Commit 93e4db1

Browse files
authored
fix: account for trailing commas (supabase#1061)
1 parent bad563a commit 93e4db1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

+7
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ function initiate_upgrade {
184184
# i.e. " , pg_stat_statements, , pgsodium, " -> "pg_stat_statements, pgsodium"
185185
SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | tr ',' ' ' | tr -s ' ' | tr ' ' ', ')
186186

187+
# Account for trailing comma
188+
# eg. "...,auto_explain,pg_tle,plan_filter," -> "...,auto_explain,pg_tle,plan_filter"
189+
if [[ "${SHARED_PRELOAD_LIBRARIES: -1}" = "," ]]; then
190+
# clean up trailing comma
191+
SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/.$//" | xargs)
192+
fi
193+
187194
PGDATAOLD=$(cat "$POSTGRES_CONFIG_PATH" | grep data_directory | sed "s/data_directory = '\(.*\)'.*/\1/")
188195

189196
PGDATANEW="$MOUNT_POINT/pgdata"

common.vars.pkr.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.1.1.79"
1+
postgres-version = "15.1.1.80"

0 commit comments

Comments
 (0)