fix(postgresql): quote extension names in CREATE EXTENSION to support hyphens

Unquoted extension names like `uuid-ossp` are interpreted as subtraction expressions by the SQL parser, causing exit code 1.
Wrapping the name in double quotes makes it valid for any extension regardless of naming.
This commit is contained in:
Robin Naundorf
2026-05-18 13:15:40 +02:00
committed by GitHub
parent 8a4c0bdc60
commit 83ffce2095

View File

@@ -7176,7 +7176,7 @@ function setup_postgresql_db() {
IFS=',' read -ra EXT_LIST <<<"${PG_DB_EXTENSIONS:-}"
for ext in "${EXT_LIST[@]}"; do
ext=$(echo "$ext" | xargs) # Trim whitespace
$STD sudo -u postgres psql -d "$PG_DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS $ext;"
$STD sudo -u postgres psql -d "$PG_DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS \"$ext\";"
done
fi