Install fails on Postgres 8.1
| Project: | Node import |
| Version: | 5.x-1.6 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Installation is failing for me on Postgres 8.1
It's throwing the following error on installation:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "(" at character 136 in /home/mark/domains/dev/public_html/drupal/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE node_import_mappings ( "type" VARCHAR(16) NOT NULL DEFAULT '', csv_headers TEXT NOT NULL, mapping TEXT NOT NULL, KEY type (type) ); in /home/mark/domains/dev/public_html/drupal/includes/database.pgsql.inc on line 144.
* The creation of node_import database tables has failed. Check the README.txt file in the modules/node_import directory on instructions to create the table manually.
The README.txt doesn't seem to contain manual instructions.
However, it appears to work if you make the following changes in node_import.install:
lines 17-22:
$ret = db_query("CREATE TABLE {node_import_mappings} ( ".
"\"type\" VARCHAR(16) NOT NULL DEFAULT '', ".
"csv_headers TEXT NOT NULL, ".
"mapping TEXT NOT NULL, ".
"PRIMARY KEY (\"type\") ".
");");
lines 43-48:
$items[] = update_sql("CREATE TABLE {node_import_mappings} ( ".
"type VARCHAR(16) NOT NULL DEFAULT '', ".
"csv_headers TEXT NOT NULL, ".
"mapping TEXT NOT NULL, ".
"KEY type (type) ".
") /*!40100 DEFAULT CHARACTER SET utf8 */;");
Has anyone else dealt with this issue? Thanks.

#1
Committed. Will be included in next release of node_import (5.x-1.7).
Note that the PRIMARY KEY() is wrong because ('type') is not a primary key. In fact, ('type', 'csv_headers') is the primary key.
#2
Automatically closed -- issue fixed for two weeks with no activity.