В связи с параллельной поддержкой и использованием 2-й и 3-й версии языка Python в настоящее время в PostgreSQL можно использовать две версии PL/Python — plpython2u или plpython3u[2].
42.1. Python 2 vs. Python 3, PostgreSQL Documentation
Литература
Regina O. Obe, Leonard Hsu. Ch. 8 Writing Functions. Writing PL/Python Functions // PostgreSQL: Up and Running. — O'Reilly Media, 2012. — P. 105-107. — 147 p. — ISBN 1449326331, 9781449326333.
Серия статей в Postgres OnLine Journal
Leo Hsu and Regina Obe Quick Intro to PLPython. — 2009-01-22. — № 99.
Leo Hsu and Regina Obe PLPython Part 2: Control Flow and Returning Sets // Postgres OnLine Journal. — 2009-01-30. — № 100.
Leo Hsu and Regina Obe PLPython Part 3: Using custom classes, pulling data from PostgreSQL // Postgres OnLine Journal. — 2009-02-04. — № 101.
Leo Hsu and Regina Obe PLPython Part 5: PLPython meets PostgreSQL Multi-column aggregates and SVG plots // Postgres OnLine Journal. — 2009-03-13. — № 105.
Korry Douglas, Susan Douglas. PostgreSQL: A Comprehensive Guide to Building, Programming, and Administering PostgreSQL Databases. — Sams Publishing, 2003. — 790 p. — (Developer's library). — ISBN 978-0-7357-1257-7.