Hi all, On 6.4.2RC1, I have just played with v.db.join after seeing it suggested for a use I thought would benefit me (I'd briefly looked at it on 6.4.1 before upgrade, had similar 'errors' there too).
when I open the dialog box for it (using wxpython GUI), from the listbox I can select vector map. I can then select 'join column in map table'. Then when I select 'other table name' the 'join column in map table' field goes blank (looking at command-line at bottom of dialog box shows "column=<required>"). I can go back to 'join column' listbox and reselect what I wanted and it seems to recognise it again, but if I change the 'other table' it will blank the 'join column' listbox each time. Then on going to last listbox 'join column in other table' it lists the column names for the map table, when it should list the columns for the other table! So I just cheated and typed in the column name I knew I wanted for 'other table'. This was what I ended up with: v.db.join --verbose map=camphors@Lacebark column=chem_cat otable=public.chemical_use ocolumn=cat DBMI-Postgres driver error: Cannot execute: ALTER TABLE camphors ADD COLUMN cat INTEGER ERROR: column "cat" of relation "camphors" already exists ERROR: Error while executing: 'ALTER TABLE camphors ADD COLUMN cat INTEGER ' ERROR: Cannot continue (problem adding column). ERROR: Cannot continue. ...... I tried again, using different columns because I thought choosing a 'cat' column might have mucked things up. this case, I tried joining on two date columns: v.db.join map=camphors@Lacebark column=camphor_date otable=public.chemical_use ocolumn=chem_date DBMI-Postgres driver error: Cannot execute: ALTER TABLE camphors ADD COLUMN cat INTEGER ERROR: column "cat" of relation "camphors" already exists ERROR: Error while executing: 'ALTER TABLE camphors ADD COLUMN cat INTEGER ' ERROR: Cannot continue (problem adding column). ERROR: Cannot continue. So it isn't the choice of columns... it's still trying to add another 'cat' column... why...? This confused me. Why does v.db.join submit and ADD COLUMN command? I expected a 'join' process to simply do that - join two tables based on an existing column from each table; then display the data from both. The info and examples in GRASS help for v.db.join show this is what should happen with the Spearfish soils example. So I thought I'd look at the vector map to see what, if anything, had happened. Just in case these error messages were not-quite-relevant. But ran into problem with query tool in map display as per separate post. So I ran v.db.select on the table I'd just ran v.db.join on, it returned the data from table one only (when having the layer selected that I'd tried running v.db.join on) i.e. join not successful. So I guess error message in this case was relevant. Have I missed something elementary, or is the v.db.join passing the wrong sort of SQL to db.execute or wherever it goes...?? What can I do about it? Regards, Shane _______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user