[OSM-dev] Problem populating rails database with planetosm-to-db.pl

Nick Whitelegg nick at hogweed.org
Sun May 20 12:21:04 BST 2007

Just tried populating the rails database using planetosm-to-db.pl.

It fails when it starts adding ways:

DBD::mysql::st execute failed: Duplicate entry '126' for key 1 
at ./planetosm-to-db.pl line 352, <XML> line 209509.

Should 'id' and 'version' actually be primary keys?  I tried stopping 'id' 
being a primary key but then it complained about duplicate entries for 
'version'. Can I get away with removing all these primary key definitions 
i.e. will I have a working Potlatch by doing so? (Don't want to waste my time 
with fruitless experiments....)

CREATE TABLE `way_segments` (
  `id` bigint(64) NOT NULL default '0',
  `segment_id` int(11) default NULL,
  `version` bigint(20) NOT NULL default '0',
  `sequence_id` bigint(11) NOT NULL auto_increment,
  PRIMARY KEY  (`id`,`version`,`sequence_id`)


More information about the dev mailing list