PL/Python

PL/Python — это вариант языка программирования Python, используемый при написании триггеро…

PL/Python

PL/Python — это вариант языка программирования Python, используемый при написании триггеров и хранимых процедур популярного сервера БД PostgreSQL.

В связи с параллельной поддержкой и использованием 2-й и 3-й версии языка Python в настоящее время в PostgreSQL можно использовать любую из двух версии PL/Python — plpython2u или plpython3u[1]. Использовать обе версии одновременно в одной сессии нельзя.[2]

Чтобы установить PL/Python в определённую базу данных, выполните команду CREATE EXTENSION plpythonu, либо запустите в оболочке системы createlang plpythonu имя_данных.

Создавать функции на недоверенных языках, таких как plpythonu, могут только суперпользователи.

Примечания

  1. 42.1. Python 2 vs. Python 3 Архивная копия от 6 ноября 2013 на Wayback Machine, PostgreSQL Documentation
  2. Reuven M. Lerner. Python Workout: 50 ten-minute exercises. — 2020. — ISBN 9781617295508. Архивная копия от 26 августа 2021 на Wayback Machine Источник. Дата обращения: 26 августа 2021. Архивировано 26 августа 2021 года.

Литература

  • Актуальная документация PL/Python.
  • 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.
    PLPython Part 4: PLPython meets aggregates // Postgres OnLine Journal. — 2009-02-05. — № 102.
    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.

Ссылки

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.