]> begriffs open source - ai-pg/blob - full-docs/txt/plpython.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / plpython.txt
1
2 Chapter 44. PL/Python — Python Procedural Language
3
4    Table of Contents
5
6    44.1. PL/Python Functions
7    44.2. Data Values
8
9         44.2.1. Data Type Mapping
10         44.2.2. Null, None
11         44.2.3. Arrays, Lists
12         44.2.4. Composite Types
13         44.2.5. Set-Returning Functions
14
15    44.3. Sharing Data
16    44.4. Anonymous Code Blocks
17    44.5. Trigger Functions
18    44.6. Database Access
19
20         44.6.1. Database Access Functions
21         44.6.2. Trapping Errors
22
23    44.7. Explicit Subtransactions
24
25         44.7.1. Subtransaction Context Managers
26
27    44.8. Transaction Management
28    44.9. Utility Functions
29    44.10. Python 2 vs. Python 3
30    44.11. Environment Variables
31
32    The PL/Python procedural language allows PostgreSQL functions and
33    procedures to be written in the Python language.
34
35    To install PL/Python in a particular database, use CREATE EXTENSION
36    plpython3u.
37
38 Tip
39
40    If a language is installed into template1, all subsequently created
41    databases will have the language installed automatically.
42
43    PL/Python is only available as an “untrusted” language, meaning it does
44    not offer any way of restricting what users can do in it and is
45    therefore named plpython3u. A trusted variant plpython might become
46    available in the future if a secure execution mechanism is developed in
47    Python. The writer of a function in untrusted PL/Python must take care
48    that the function cannot be used to do anything unwanted, since it will
49    be able to do anything that could be done by a user logged in as the
50    database administrator. Only superusers can create functions in
51    untrusted languages such as plpython3u.
52
53 Note
54
55    Users of source packages must specially enable the build of PL/Python
56    during the installation process. (Refer to the installation
57    instructions for more information.) Users of binary packages might find
58    PL/Python in a separate subpackage.