1- <!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.16 2003/04/07 01:29:25 petere Exp $ -->
1+ <!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.17 2003/06/30 18:31:41 tgl Exp $ -->
22
33<chapter id="plpython">
44 <title>PL/Python - Python Procedural Language</title>
1414
1515 <para>
1616 To install PL/Python in a particular database, use
17- <literal>createlangplpython <replaceable>dbname</></literal>.
17+ <literal>createlangplpythonu <replaceable>dbname</></literal>.
1818 </para>
1919
20+ <note>
21+ <para>
22+ As of <productname>PostgreSQL</productname> 7.4,
23+ PL/Python is only available as an <quote>untrusted</> language
24+ (meaning it does not offer any way of restricting what users
25+ can do in it). It has therefore been renamed to <literal>plpythonu</>.
26+ The trusted variant <literal>plpython</> may become available again in
27+ future, if a new secure execution mechanism is developed by the Python
28+ community.
29+ </para>
30+ </note>
31+
2032 <tip>
2133 <para>
2234 If a language is installed into <literal>template1</>, all subsequently
4153<programlisting>
4254CREATE FUNCTION myfunc(text) RETURNS text
4355 AS 'return args[0]'
44- LANGUAGEplpython ;
56+ LANGUAGEplpythonu ;
4557</programlisting>
4658
4759 gets transformed into
@@ -78,13 +90,18 @@ def __plpython_procedure_myfunc_23456():
7890 available to all Python functions within a session. Use with care.
7991 </para>
8092
93+ <!-- NOT CORRECT ANYMORE, IS IT?
94+
8195 <para>
8296 Each function gets its own restricted execution object in the
8397 Python interpreter, so that global data and function arguments from
8498 <function>myfunc</function> are not available to
8599 <function>myfunc2</function>. The exception is the data in the
86100 <varname>GD</varname> dictionary, as mentioned above.
87101 </para>
102+
103+ -->
104+
88105 </sect1>
89106
90107 <sect1 id="plpython-trigger">
@@ -218,11 +235,13 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS '
218235 plan = plpy.prepare("SELECT 1")
219236 SD["plan"] = plan
220237 # rest of function
221- ' LANGUAGEplpython ;
238+ ' LANGUAGEplpythonu ;
222239</programlisting>
223240 </para>
224241 </sect1>
225242
243+ <!-- NOT CURRENTLY SUPPORTED
244+
226245 <sect1 id="plpython-trusted">
227246 <title>Restricted Environment</title>
228247
@@ -245,4 +264,6 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS '
245264 </para>
246265 </sect1>
247266
267+ -->
268+
248269</chapter>