Browse Source

fix: [postgres] support of extension names with ``.`` or ``-``

master
Valentin Lab 3 weeks ago
parent
commit
d999dd741e
  1. 6
      postgres/lib/common

6
postgres/lib/common

@ -91,7 +91,11 @@ db_install_extensions() {
info "Installed postgis extensions on database '$dbname'."
;;
*)
ddb -d "$dbname" < <(echo "CREATE EXTENSION IF NOT EXISTS $1;") || return 1
if ! [[ "$1" =~ ^[0-9a-zA-Z_.-]+$ ]]; then
err "Invalid extension name: $1"
return 1
fi
ddb -d "$dbname" < <(echo "CREATE EXTENSION IF NOT EXISTS \"$1\";") || return 1
info "Installed $1 extension on database '$dbname'."
;;
esac

Loading…
Cancel
Save