mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
postgresql-init-dev-db: Fix string quotes.
The previous version of the script did not quote VAGRANTUSERNAME, which caused an error when running the script if the username contained `-` or other characters that affect the Postgres syntax. Fix this using double-quotes.
This commit is contained in:
@@ -75,12 +75,12 @@ ALTER USER $USERNAME CREATEDB;
|
||||
ALTER ROLE $USERNAME SET search_path TO $SEARCH_PATH;
|
||||
|
||||
DO \$\$BEGIN
|
||||
CREATE USER $VAGRANTUSERNAME;
|
||||
CREATE USER "$VAGRANTUSERNAME";
|
||||
EXCEPTION WHEN duplicate_object THEN
|
||||
RAISE NOTICE '$VAGRANTUSERNAME user already exists';
|
||||
END\$\$;
|
||||
GRANT $USERNAME TO $VAGRANTUSERNAME;
|
||||
ALTER ROLE $VAGRANTUSERNAME SET search_path TO $SEARCH_PATH;
|
||||
GRANT $USERNAME TO "$VAGRANTUSERNAME";
|
||||
ALTER ROLE "$VAGRANTUSERNAME" SET search_path TO $SEARCH_PATH;
|
||||
EOF
|
||||
|
||||
umask go-rw
|
||||
|
||||
Reference in New Issue
Block a user