Skip to content

[Bug] v.db.join fails, existing cat #3864

@ecodiv

Description

@ecodiv

Describe the bug

Running the example from the v.db.join manual page, v.db.join fails with:

GRASS nc_spm_08_grass7/user1:Downloads > v.db.join map=mygeology column=GEO_NAME other_table=nc_geology other_column=geol_id
DBMI-SQLite driver error:
Error in sqlite3_step():
UNIQUE constraint failed: mygeology.cat

DBMI-SQLite driver error:
Error in sqlite3_step():
UNIQUE constraint failed: mygeology.cat

ERROR: Error while executing: 'UPDATE mygeology SET cat = (SELECT cat FROM
       nc_geology WHERE nc_geology.geol_id=mygeology.GEO_NAME)'
ERROR: Error filling columns {'cat': ['INTEGER', '20'], 'geol_id': ['TEXT',
       '1000'], 'longname': ['TEXT', '1000'], 'comment': ['TEXT', '1000']}
GRASS nc_spm_08_grass7/user1:Downloads > 

To reproduce

  • db.in.ogr input=nc_geology.csv output=nc_geology
  • g.copy vector=geology,mygeology
  • v.db.join map=mygeology column=GEO_NAME other_table=nc_geology other_column=geol_id

Expected behavior

Screenshots

System description

  • Operating System: Linux, Ubuntu 22.04
  • GRASS GIS version: 8.5dev

Additional context

Not sure if this is related to #3765

Related to the example code, why the nc_geology table a cat column has in the first place. Why, when importing a CSV file with db.in.ogr, a new column cat is created?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions