|
From: Alex T. <at...@gr...> - 2013-12-31 00:01:59
|
*
============================================================================
POSTGRES-XC BUG REPORT TEMPLATE
============================================================================
Your name : alex
Your email address : al...@gr...
System Configuration:
---------------------
Architecture : amd64 (xen)
Operating System : Ubuntu 12.04.3
Postgres-XC version : Postgres-XC 1.1
Compiler used : gcc 4.6.3
Please enter a FULL description of your problem:
------------------------------------------------
initdb (and pg_ctl initdb) don't seem to be able to handle a hyphen in
the nodename. I've tried a couple quoting/escaping strategies but
nothing exhaustive.
dev1-pgxdn0001:/data # sudo -H -u postgres-xc initdb -D /data/datanode1
-U root -W --nodename=dev1-pgxdn0001d
The files belonging to this database system will be owned by user
"postgres-xc".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
creating directory /data/datanode1 ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 24MB
creating configuration files ... ok
creating template1 database in /data/datanode1/base/1 ... ok
initializing pg_authid ... ok
Enter new superuser password:
Enter it again:
setting password ... ok
initializing dependencies ... ok
creating system views ... ok
creating cluster information ... FATAL: syntax error at or near "-" at
character 17
STATEMENT: CREATE NODE dev1-pgxdn0001d WITH (type = 'coordinator');
child process exited with exit code 1
initdb: removing data directory "/data/datanode1"
When I do the same thing with nodename dev1pgxdn0001d it's fine.
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
Try to initialize a database cluster with and without hyphen in the
nodename:
initdb -D /tmp/test1 --nodename=with-hyphen
initdb -D /tmp/test2 --nodename=no-hyphen
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------*
This should work for initdb, but I haven't checked where else SQL code
references the node name unquoted, so until I (or someone) has done that
audit it's probably best initdb fail than have run time failures:
--- postgres-xc/src/bin/initdb/initdb.c.orig 2013-12-30
15:56:33.010544683 -0800
+++ postgres-xc/src/bin/initdb/initdb.c 2013-12-30 15:57:09.338340863
-0800
@@ -1554,7 +1554,7 @@
PG_CMD_OPEN;
- PG_CMD_PRINTF1("CREATE NODE %s WITH (type = 'coordinator');\n",
+ PG_CMD_PRINTF1("CREATE NODE '%s' WITH (type = 'coordinator');\n",
nodename);
PG_CMD_CLOSE;
|