forked from ungleich-public/cdist
__postgres_*: use delimited identifiers (double quoted) in generated SQL
This commit is contained in:
parent
df05abd15b
commit
beb930c0dc
2 changed files with 4 additions and 4 deletions
|
@ -41,12 +41,12 @@ if [ "$state_should" != "$state_is" ]; then
|
||||||
present)
|
present)
|
||||||
owner=""
|
owner=""
|
||||||
if [ -f "$__object/parameter/owner" ]; then
|
if [ -f "$__object/parameter/owner" ]; then
|
||||||
owner="-O '$(cat "$__object/parameter/owner")'"
|
owner="-O \"$(cat "$__object/parameter/owner")\""
|
||||||
fi
|
fi
|
||||||
echo "su - '$postgres_user' -c \"createdb $owner '$name'\""
|
echo "su - '$postgres_user' -c \"createdb $owner \"$name\"\""
|
||||||
;;
|
;;
|
||||||
absent)
|
absent)
|
||||||
echo "su - '$postgres_user' -c \"dropdb '$name'\""
|
echo "su - '$postgres_user' -c \"dropdb \"$name\"\""
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -54,7 +54,7 @@ case "$state_should" in
|
||||||
|
|
||||||
[ -n "$password" ] && password="PASSWORD '$password'"
|
[ -n "$password" ] && password="PASSWORD '$password'"
|
||||||
|
|
||||||
cmd="CREATE ROLE $name WITH $password $booleans"
|
cmd="CREATE ROLE \"$name\" WITH $password $booleans"
|
||||||
echo "su - '$postgres_user' -c \"psql postgres -wc \\\"$cmd\\\"\""
|
echo "su - '$postgres_user' -c \"psql postgres -wc \\\"$cmd\\\"\""
|
||||||
;;
|
;;
|
||||||
absent)
|
absent)
|
||||||
|
|
Loading…
Reference in a new issue