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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user