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?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/uNbHl4LyNrQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.