Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
b6f0c502
Commit
b6f0c502
authored
22 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Small update for the removal of some memory leaks in plpython SGML example.
Nigel J. Andrews
parent
b825a8f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/plpython.sgml
+17
-8
17 additions, 8 deletions
doc/src/sgml/plpython.sgml
with
17 additions
and
8 deletions
doc/src/sgml/plpython.sgml
+
17
−
8
View file @
b6f0c502
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.1
4
2002/
09/23 01:51
:0
2
momjian Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.1
5
2002/
10/21 20:34
:0
9
momjian Exp $ -->
<chapter id="plpython">
<chapter id="plpython">
<title>PL/Python - Python Procedural Language</title>
<title>PL/Python - Python Procedural Language</title>
...
@@ -198,15 +198,24 @@ rv = plpy.execute(plan, [ "name" ], 5)
...
@@ -198,15 +198,24 @@ rv = plpy.execute(plan, [ "name" ], 5)
<para>
<para>
When you prepare a plan using the PL/Python module it is
When you prepare a plan using the PL/Python module it is
automatically saved. Read the SPI documentation (<xref
automatically saved. Read the SPI documentation (<xref
linkend="spi">) for a description of what this means. The take
linkend="spi">) for a description of what this means.
home message is if you do
</para>
<para>
In order to make effective use of this across function calls
one needs to use one of the persistent storage dictionaries
<literal>SD</literal> or <literal>GD</literal>, see
<xref linkend="plpython-funcs">. For example:
<programlisting>
<programlisting>
plan = plpy.prepare("SOME QUERY")
CREATE FUNCTION usesavedplan ( ) RETURNS TRIGGER AS '
plan = plpy.prepare("SOME OTHER QUERY")
if SD.has_key("plan"):
plan = SD["plan"]
else:
plan = plpy.prepare("SELECT 1")
SD["plan"] = plan
# rest of function
' LANGUAGE 'plpython';
</programlisting>
</programlisting>
you are leaking memory, as I know of no way to free a saved plan.
The alternative of using unsaved plans it even more painful (for
me).
</para>
</para>
</sect1>
</sect1>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment