Properly quote database name while dropping it on remote node
authorPavan Deolasee <[email protected]>
Wed, 7 Sep 2016 04:55:52 +0000 (10:25 +0530)
committerPavan Deolasee <[email protected]>
Wed, 7 Sep 2016 04:55:52 +0000 (10:25 +0530)
Per bug report by Răzvan-Sebastian Botez

src/backend/tcop/utility.c

index cc8e06e8e7e136dc149c1b5f8f74c6f7658e5bc0..b73be0ab6e3a30a9b6db1aea2cc71c50c5e55cae 100644 (file)
@@ -807,7 +807,8 @@ standard_ProcessUtility(Node *parsetree,
                                        DropDBCleanConnection(stmt->dbname);
 
                                        /* Clean also remote Coordinators */
-                                       sprintf(query, "CLEAN CONNECTION TO ALL FOR DATABASE %s;", stmt->dbname);
+                                       sprintf(query, "CLEAN CONNECTION TO ALL FOR DATABASE %s;",
+                                                       quote_identifier(stmt->dbname));
 
                                        ExecUtilityStmtOnNodes(query, NULL, sentToRemote, true, EXEC_ON_ALL_NODES, false);
                                }