0

I am really new to Postgres-XL, and I have just created a testing cluster, running postgres-xl-9.5r1.3.

It's set-up on three nodes, one node GTM, and two with both a Coordinator and a Datanode on each.

I am planning on load balancing between these two nodes, but at the moment I am just connecting and running SQL queries on the first coordinator.

While testing some basic commands, I created a a few testing databases, one of which has a fully numeric name, "213", and one with a name that starts with a digit, "123test". When trying to drop either of these, I get a syntax error:

postgres=# DROP DATABASE "213";
ERROR:  syntax error at or near "213"

postgres=# drop database 123test;
ERROR:  syntax error at or near "123"
LINE 1: drop database 123test;

postgres=# drop database "123test";
ERROR:  syntax error at or near "123"

Dropping a database that has a name which starts with a letter works just fine.

Would anyone know how to go about and delete these databases? Am I doing something wrong, or is this an issue with Postgres-XL?

4

1 回答 1

0

我已经通过他们的错误报告邮件列表联系了 Postgres-XL 团队,这似乎是一个与在向远程节点发送命令时如何引用数据库名称有关的错误。

Postgres-XL 团队提供的以下补丁应该可以解决这个问题:

diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index cc8e06e..b73be0a 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -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);
                }
于 2016-09-01T09:30:34.773 回答