In node_import.install the pgsql instructions did not work on my system (Drupal 5.2 + PHP: 5.2.3-1ubuntu6 + PostgreSQL database 8.2.5). It did not create the table node_import_mappings, which led to error messages during the import of nodes.

This is what i changed in the node_import.install file to get everything to work properly:

The original line 16:

case 'pgsql':
      $ret = db_query("CREATE TABLE {node_import_mappings} ( ".
                      "type VARCHAR(16) NOT NULL DEFAULT '', ".
                      "csv_headers TEXT NOT NULL, ".
                      "mapping TEXT NOT NULL, ".
                      "KEY type (type) ".
                      ");");
      break;

Changed to:

case 'pgsql':
      $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\") ".
                      ");");
      break;

And the original line 50:

case 'pgsql':
      $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) ".
                            ");");
      break;

Changed to:

case 'pgsql':
      $items[] = update_sql("CREATE TABLE {node_import_mappings} ( ".
                            "\"type\" VARCHAR(16) NOT NULL DEFAULT '', ".
                            "csv_headers TEXT NOT NULL, ".
                            "mapping TEXT NOT NULL, ".
                            "PRIMARY KEY (\"type\") ".
                            ");");
      break;

I hope this will help someone.

Comments

Robrecht Jacques’s picture

Status: Needs review » Fixed

Committed to DRUPAL-5 branch. Will be included in the next release (5.x-1.3). Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.