title: Transaction support in psycopg2
body: <p>I'm little confused reading the <strong>psycopg2</strong> documentation about how it handles transactions (apart from using it with <code>with</code> statement).</p>
  
  <p>Reading through the <a href="http://initd.org/psycopg/docs/connection.html" rel="nofollow noreferrer">docs</a>, I see</p>
  
  <blockquote>
    <p>By default, Psycopg opens a transaction before executing the first
    command: if commit() is not called, the effect of any data
    manipulation will be lost.</p>
  </blockquote>
  
  <p>Assuming the above statement to be correct</p>
  
  <pre><code>dbconn = psycopg2.connect(...)   cursor = dbconn.cursor()
  cursor.execute("insert record into a") 
  cursor.execute("insert record into b")
  
  cursor.execute("insert record into c") // This throw integrity error.
  cursor.execute("commit") // this logs "WARNING:  there is no transaction in progress"
  </code></pre>
  
  <p>The data manipulation for <code>a</code>, <code>b</code> would get <strong>lost</strong>.</p>
  
  <p>But as I see it, this is not happening on PostgreSQL. I'm definitely missing something over here, but right now I am not sure what and where.</p>