]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Dropped erroneous statement that psycopg3 quotes values
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 5 Dec 2020 00:52:05 +0000 (00:52 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 5 Dec 2020 00:52:05 +0000 (00:52 +0000)
docs/params.rst

index d459985e77df3653b874379dcef809770b6ceab3..7d22b5f127393a25911c6a3e227aef5e27bdea3f 100644 (file)
@@ -92,14 +92,14 @@ query.
     cur.execute("INSERT INTO foo VALUES (%s)", ("bar",)) # correct
     cur.execute("INSERT INTO foo VALUES (%s)", ["bar"])  # correct
 
-- The placeholder *must not be quoted*. Psycopg will add quotes where needed::
+- The placeholder *must not be quoted*::
 
-    cur.execute("INSERT INTO numbers VALUES ('%s')", (10,)) # WRONG
-    cur.execute("INSERT INTO numbers VALUES (%s)", (10,))   # correct
+    cur.execute("INSERT INTO numbers VALUES ('%s')", ("Hello",)) # WRONG
+    cur.execute("INSERT INTO numbers VALUES (%s)", ("Hello",))   # correct
 
 - The variables placeholder *must always be a* ``%s``, even if a different
   placeholder (such as a ``%d`` for integers or ``%f`` for floats) may look
-  more appropriate for tye type. Another placeholder you can use is ``%b``, to
+  more appropriate for the type. Another placeholder you can use is ``%b``, to
   :ref:`adapt the object to binary type <binary-data>`::
 
     cur.execute("INSERT INTO numbers VALUES (%d)", (10,))   # WRONG