Escape tablespace name when creating postgresql tablespace
authorclinton_admin <clinton_admin@fritz.hcoop.net>
Sun, 25 Mar 2012 07:13:23 +0000 (03:13 -0400)
committerclinton_admin <clinton_admin@fritz.hcoop.net>
Sun, 25 Mar 2012 07:13:23 +0000 (03:13 -0400)
* Previously, a name with a '-' would break things
* Usernames containing '"' are invalid anyway so we should be bulletproof

create-user-database

index cf855c4..bc2ca60 100755 (executable)
@@ -16,7 +16,7 @@ MYSQLDIR=$DBPATH/mysql
 if ! test -d $PGDIR; then
   mkdir -p $PGDIR
   chown postgres:postgres $PGDIR
-  sudo -u postgres psql -c "CREATE TABLESPACE user_$USER OWNER postgres LOCATION '$PGDIR'" template1
+  sudo -u postgres psql -c "CREATE TABLESPACE \"user_$USER\" OWNER postgres LOCATION '$PGDIR'" template1
 fi
 
 # Create mysql user and databases placeholder within volume