I am working on a project using psycopg2 together with python 2.7 where I have one writer to a DB table and multiple readers from the same table. On python I am using the TCP socketserver with the ThreadingMixin where each thread create their own connection and cursor , read the data and then commit and close. This is working fine.
Right now I have a situation where I can have multiple writers to the same table and there is a chance for concurrency issues .
I am not a Postgres guy but I tried to read the documentation and I believe that Explicit Locking --> Table level Locks --> ROW EXCLUSIVE are the way to go .
Can someone give me some guidance on the concurrency control and important also how I can translate this into python psycopg code ??
Many thanks