I am running pgdb.connect to make a connection to my postgresql server and cursor to execute queries. For the first time (sometimes twice) it works properly but after that it gives me
OperationalError: Can't start transaction
on "cursor.execute(query)"
Can someone please help me on how to solve this error?
I am using docker compose with one containing postgresql and another a flask server.