v.db.join and "duplicate column name"
|vector db join
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 PROV CHARACTER ' 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