Browse Source

new: [postres] support user with dots in their name

framadate
Valentin Lab 6 years ago
parent
commit
a68c45e1f2
  1. 4
      postgres/lib/common

4
postgres/lib/common

@ -81,13 +81,13 @@ db_has_user() {
db_create_user() { db_create_user() {
local user="$1" password="$2" local user="$1" password="$2"
## Using this instead of pipes is important so that trap works ## Using this instead of pipes is important so that trap works
ddb < <(echo "CREATE USER $user WITH PASSWORD '$password' CREATEDB NOCREATEROLE;")
ddb < <(echo "CREATE USER \"$user\" WITH PASSWORD '$password' CREATEDB NOCREATEROLE;")
} }
db_change_password() { db_change_password() {
local user="$1" password="$2" local user="$1" password="$2"
## Using this instead of pipes is important so that trap works ## Using this instead of pipes is important so that trap works
ddb < <(echo "ALTER USER $user WITH PASSWORD '$password';")
ddb < <(echo "ALTER USER \"$user\" WITH PASSWORD '$password';")
} }

Loading…
Cancel
Save