]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix var name in transactions doc examples
authorRamiro Morales <cramm0@gmail.com>
Sun, 17 Oct 2021 01:04:35 +0000 (22:04 -0300)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 17 Oct 2021 11:32:49 +0000 (12:32 +0100)
docs/basic/transactions.rst

index c92da377966a8bbb793e238d0ec72dcbeca2b58c..1db04d5ddc133e145949e3b674b2e847ffa20dfc 100644 (file)
@@ -34,7 +34,7 @@ disappointed by it), is likely:
 
     # Creating a cursor doesn't start a transaction or affect the connection
     # in any way.
-    cur = con.cursor()
+    cur = conn.cursor()
 
     cur.execute("SELECT count(*) FROM my_table")
     # This function call executes:
@@ -68,7 +68,7 @@ sequence of database statements:
 
     with psycopg.connect() as conn:
 
-        cur = con.cursor()
+        cur = conn.cursor()
 
         cur.execute("SELECT count(*) FROM my_table")
         # This function call executes:
@@ -127,7 +127,7 @@ With an autocommit transaction, the above sequence of operation results in:
 
     with psycopg.connect(autocommit=True) as conn:
 
-        cur = con.cursor()
+        cur = conn.cursor()
 
         cur.execute("SELECT count(*) FROM my_table")
         # This function call now only executes:
@@ -169,7 +169,7 @@ use a `!transaction()` context:
 
     with psycopg.connect(autocommit=True) as conn:
 
-        cur = con.cursor()
+        cur = conn.cursor()
 
         cur.execute("SELECT count(*) FROM my_table")
         # The connection is autocommit, so no BEGIN executed.
@@ -198,7 +198,7 @@ as explained in :ref:`transactions`:
 
     conn = psycopg.connect()
 
-    cur = con.cursor()
+    cur = conn.cursor()
 
     cur.execute("SELECT count(*) FROM my_table")
     # This function call executes: