Skip to content

Commit 3e81a33

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

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
@@ -1037,7 +1037,11 @@ rv = plpy.execute(plan, ["name"], 5)
10371037
<xref linkend="plpython-sharing">). For example:
10381038
<programlisting>
10391039
CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
1040-
plan = SD.setdefault("plan", plpy.prepare("SELECT 1"))
1040+
if "plan" in SD:
1041+
plan = SD["plan"]
1042+
else:
1043+
plan = plpy.prepare("SELECT 1")
1044+
SD["plan"] = plan
10411045
# rest of function
10421046
$$ LANGUAGE plpythonu;
10431047
</programlisting>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy