Browse code

- add proper quoting to the database name to allow names with '-' inside - closes #1868687

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3579 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 24/01/2008 16:19:25
Showing 1 changed files
... ...
@@ -80,7 +80,7 @@ if [ $# -ne 1 ] ; then
80 80
 fi
81 81
 
82 82
 # postgresql users are not dropped automatically
83
-sql_query "template1" "drop database $1; drop user \"$DBRWUSER\"; drop user \"$DBROUSER\";"
83
+sql_query "template1" "drop database \"$1\"; drop user \"$DBRWUSER\"; drop user \"$DBROUSER\";"
84 84
 
85 85
 if [ $? -ne 0 ] ; then
86 86
 	merr "Dropping database $1 failed!"
... ...
@@ -99,7 +99,7 @@ fi
99 99
 
100 100
 minfo "creating database $1 ..."
101 101
 
102
-sql_query "template1" "create database $1;"
102
+sql_query "template1" "create database \"$1\";"
103 103
 if [ $? -ne 0 ] ; then
104 104
 	merr "Creating database failed!"
105 105
 	exit 1