mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-06-13 19:15:15 +02:00
Quote PostgreSQL extension names
Wrap the extension identifier in double quotes in the CREATE EXTENSION SQL call within setup_postgresql_db. This ensures extension names containing hyphens, mixed case, or other characters that require quoting are handled correctly and avoids syntax errors when creating extensions.
This commit is contained in:
+1
-1
@@ -8098,7 +8098,7 @@ 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user