title: How to use "INSERT" in psycopg2 connection pooling?
body: <p>I use psycopg2 to connect to PostgreSQL on Python and I want to use connection pooling.</p>
  
  <p>I don't know what should I do instead commit() and rollback() when I execute INSERT query.</p>
  
  <pre><code>db = pool.SimpleConnectionPool(1, 10,host=conf_hostname,database=conf_dbname,user=conf_dbuser,password=conf_dbpass,port=conf_dbport)
  
  
  # Get Cursor
  @contextmanager
  def get_cursor():
      con = db.getconn()
      try:
          yield con.cursor()
      finally:
          db.putconn(con)
  
  
  with get_cursor() as cursor:
      cursor.execute("INSERT INTO table (fields) VALUES (values) RETURNING id") 
      id = cursor.fetchone()
  </code></pre>
  
  <p>I don't get id of inserted record without commit().</p>