From 731204e0903b32b496d536acddc10df458bab186 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 7 Jan 2002 02:29:15 +0000 Subject: Editorial review --- doc/src/sgml/plpython.sgml | 76 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 23 deletions(-) (limited to 'doc/src/sgml/plpython.sgml') diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml index 485eea06ca..768c26b569 100644 --- a/doc/src/sgml/plpython.sgml +++ b/doc/src/sgml/plpython.sgml @@ -1,4 +1,4 @@ - + PL/Python - Python Procedural Language @@ -6,44 +6,74 @@ PL/Python Python - + + Introduction + - This chapter is not fully developed yet. + The PL/Python procedural language allows + PostgreSQL functions to be written in + the Python language. + - The current version of PL/Python functions as a trusted language only; - access to the filesystem and other local resources are disabled. - Specifically, PL/Python uses the Python restricted execution environment, - further restricts it to prevent the use of the file open call, and - allows only modules from a specific list to be imported. Presently, - that list includes: array, bisect, binascii, calendar, cmath, codecs, - errno, marshal, math, md5, mpz, operator, pcre, pickle, random, re, - regex, sre, sha, string, StringIO, struct, time, whrandom, and zlib. + The current version of PL/Python + functions as a trusted language only; access to the file system and + other local resources is disabled. Specifically, + PL/Python uses the Python restricted + execution environment, further restricts it to prevent the use of + the file open call, and allows only modules from a + specific list to be imported. Presently, that list includes: + array, bisect, binascii, calendar, cmath, codecs, errno, marshal, + math, md5, mpz, operator, pcre, pickle, random, re, regex, sre, + sha, string, StringIO, struct, time, whrandom, and zlib. + - There is discussion on creating an untrusted language variant for a + In the current version, any database error encountered while + running a PL/Python function will result + in the immediate termination of that function by the server. It is + not possible to trap error conditions using Python try + ... catch constructs. For example, a syntax error in an + SQL statement passed to the plpy.execute() call + will terminate the function. This behavior may be changed in a future release. - - In the current version, any postgresql error encountered while running - a PL/Python function will result in the immediate termination of that - function by the backend. It is not possible to trap error conditions - using Python try ... catch constructs. For example, a syntax error in - an SQL statement passed to the plpy.execute() call will terminate the - function. This behavior may be changed in a future release. - - + Installation - ... needs to be worked out. + To build PL/Python, the option needs + to be specified when running configure. If + after building and installing you have a file called + plpython.so (possibly a different extension), + then everything went well. Otherwise you should have seen a notice + like this flying by: + +*** Cannot build PL/Python because libpython is not a shared library. +*** You might have to rebuild your Python installation. Refer to +*** the documentation for details. + + That means you have to rebuild (part of) your Python installation + to supply this shared library. + + + + The catch is that the Python distribution or the Python maintainers + do not provide any direct way to do this. The closest thing we can + offer you is the information in Python FAQ + 3.30. On some operating systems you don't really have to + build a shared library, but then you will have to convince the + PostgreSQL build system of this. Consult the + Makefile in the + src/pl/plpython directory for details. - Using + Using PL/Python There are sample functions in -- cgit v1.2.1