[GRASS-dev] [GRASS GIS] #1393: v.db.join and "duplicate column name"

GRASS GIS trac at osgeo.org
Tue Jun 21 09:52:31 EDT 2011

#1393: v.db.join and "duplicate column name"
 Reporter:  lucadelu        |       Owner:  grass-dev@…              
     Type:  defect          |      Status:  new                      
 Priority:  major           |   Milestone:  6.4.2                    
Component:  Vector          |     Version:  unspecified              
 Keywords:  vector db join  |    Platform:  All                      
      Cpu:  Unspecified     |  
 Today I found a problem when I try to join tables with v.db.join. The
 problem was that the key columns have the same name and the join returned
 an error.

 v.db.join map=confini_provinciali column=PROV otable=tabprovince ocol=PROV

 DBMI-SQLite driver error:
 Error in sqlite3_prepare():
 duplicate column name: PROV

 ERROR: Error while executing: 'ALTER TABLE confini_provinciali ADD COLUMN
 ERROR: Cannot continue (problem adding column).
 ERROR: Cannot continue.

 To solve this problem I adding two flag that they permit to pass it.
 One permit to not copy the join column, the data of join column are
 already present on the map table; the other flag permit to copy all the
 column from other_table adding "_o" to the columns name. This is the idea
 used by v.overlay that add "_a" at the columns of ainput and "_b" for the
 columns of binput. In attachment you can found the patch, test it and if
 you think that it's a good solution please add it to the svn

Ticket URL: <http://trac.osgeo.org/grass/ticket/1393>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list