postgres.git / summary / log / commit / refs
commit 37f3fa9ca779b2970d6f9629385acd9e24bba48a
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Wed Nov 11 17:20:34 2026 +0000
First released in: 19.0
Doc: fix imprecise description of PL/Python's "SD" dictionary.
We omitted the rather important detail that a trigger function
has one SD instance per triggered-on relation, rather than a
single shared instance as the existing text stated.
Discussion: https://postgr.es/m/3245516.1794415242@sss.pgh.pa.us
Backpatch-through: 15
doc/src/sgml/plpython.sgml | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml
index bee817ea822..a2d88976d3c 100644
--- a/doc/src/sgml/plpython.sgml
+++ b/doc/src/sgml/plpython.sgml
@@ -620,9 +620,16 @@ SELECT * FROM multiout_simple_setof(3);
<title>Sharing Data</title>
<para>
The global dictionary <varname>SD</varname> is available to store
- private data between repeated calls to the same function.
+ private data between repeated calls to the same function
+ within a session. Each PL/Python function has its own instance
+ of <varname>SD</varname>, except that for trigger functions, there is
+ one instance of <varname>SD</varname> per function per triggered-on
+ relation.
+ </para>
+
+ <para>
The global dictionary <varname>GD</varname> is public data,
- that is available to all Python functions within a session; use with
+ that is available to all PL/Python functions within a session; use with
care.<indexterm><primary>global data</primary>
<secondary>in PL/Python</secondary></indexterm>
</para>
[parent: 50cbffb7917a]