Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4ffa880

Browse files
committed
PL/Python: Fix example
Revert "6f6b46c9c0ca3d96acbebc5499c32ee6369e1eec", which was broken. Reported-by: Jonathan Rogers <jrogers@socialserve.com>
1 parent f41ed7b commit 4ffa880

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/src/sgml/plpython.sgml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,11 @@ rv = plpy.execute(plan, ["name"], 5)
10441044
<xref linkend="plpython-sharing">). For example:
10451045
<programlisting>
10461046
CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
1047-
plan = SD.setdefault("plan", plpy.prepare("SELECT 1"))
1047+
if "plan" in SD:
1048+
plan = SD["plan"]
1049+
else:
1050+
plan = plpy.prepare("SELECT 1")
1051+
SD["plan"] = plan
10481052
# rest of function
10491053
$$ LANGUAGE plpythonu;
10501054
</programlisting>

0 commit comments

Comments
 (0)