I'm new at SA and I run into problems with natural primary keys. These are PK's not created by a Postgres sequence, but are unique strings. I insert/upgrade data from a csv.
When the PK is new everything works fine, but when an existing record has to be updated the following error is given:
IntegrityError: (IntegrityError) duplicate key value violates unique constraint store_item_pkey
I use the following SA code to insert/update
db.session.add(import)
db.session.commit()
At first I thought there was something wrong with my SA, but after reading the SA documentation and searching on Internet, I think it has anything to do with the natural primary keys. Any advice on how to solve this?