summaryrefslogtreecommitdiff
path: root/doc/src/sgml/plpython.sgml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/sgml/plpython.sgml')
-rw-r--r--doc/src/sgml/plpython.sgml6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml
index 27c4467ba7d..c447452b7c5 100644
--- a/doc/src/sgml/plpython.sgml
+++ b/doc/src/sgml/plpython.sgml
@@ -1065,7 +1065,7 @@ $$ LANGUAGE plpython3u;
<programlisting>
CREATE FUNCTION count_odd_iterator() RETURNS integer AS $$
odd = 0
-for row in plpy.cursor("select num from largetable"):
+for row in plpy.cursor("SELECT num FROM largetable"):
if row['num'] % 2:
odd += 1
return odd
@@ -1073,7 +1073,7 @@ $$ LANGUAGE plpython3u;
CREATE FUNCTION count_odd_fetch(batch_size integer) RETURNS integer AS $$
odd = 0
-cursor = plpy.cursor("select num from largetable")
+cursor = plpy.cursor("SELECT num FROM largetable")
while True:
rows = cursor.fetch(batch_size)
if not rows:
@@ -1086,7 +1086,7 @@ $$ LANGUAGE plpython3u;
CREATE FUNCTION count_odd_prepared() RETURNS integer AS $$
odd = 0
-plan = plpy.prepare("select num from largetable where num % $1 &lt;&gt; 0", ["integer"])
+plan = plpy.prepare("SELECT num FROM largetable WHERE num % $1 &lt;&gt; 0", ["integer"])
rows = list(plpy.cursor(plan, [2])) # or: = list(plan.cursor([2]))
return len(rows)