I have multiple worker processing job from a queue, and during the processing each worker opens a connection without closing it. Is there any consequence in doing so?
For example
conn = psycopg2.connect(dbname="my_db_name",
user="my_user",
password="my_password",
host="my_host",
port="5432")
cur = conn.cursor()
cur.execute("SELECT * FROM test;")
cur.fetchone()
conn.commit()
# What happen if I omit the line below for each job?
# cur.close()
# conn.close()