Let's say I have a tabel similar to this one:
PERSON:
id | person_name
ITEM:
id | name | person_id
Items person_id is a FK to person.
I have an operation that add's items in bulk to a person. But I want to make sure no other processes are adding items concurrently to this person without blocking the entire person table.
Is there a way to achieve this in Postgres? And better a the code to accomplish this using Python SQLalchemy?