changeset 202:b217dc3b654a

USASR-1835: Attempt to fix quoting of database name in sql
author Christopher Springer <springer@nwoca.org>
date Fri, 21 Aug 2015 12:40:01 +0100
parents e721a977726b
children a3c507b868a9
files init20.gradle
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/init20.gradle	Fri Aug 21 12:32:03 2015 +0100
+++ b/init20.gradle	Fri Aug 21 12:40:01 2015 +0100
@@ -298,8 +298,8 @@
                                 driverName)
                         if (dropIt) {
 							logger.info "disconnecting sessions from $databaseName"
-							sql.execute "REVOKE CONNECT ON DATABASE " + databaseName + " FROM public;"
-							sql.execute "REVOKE CONNECT ON DATABASE " + databaseName + " FROM " + gradle.environmentDatabase.jdbc.username + ";"
+							sql.execute "REVOKE CONNECT ON DATABASE \"" + databaseName + "\" FROM public;"
+							sql.execute "REVOKE CONNECT ON DATABASE \"" + databaseName + "\" FROM " + gradle.environmentDatabase.jdbc.username + ";"
 							sql.execute "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '" + databaseName + "';"
                             logger.info "dropping $databaseName (if exists) from $adminUrl"
                             sql.execute 'DROP DATABASE IF EXISTS "' + databaseName + '";'