Postgres with Python inside and out: PL/Python
summary
Shows how to install and use PL/PythonU in PostgreSQL to run Python code inside the database, creating a function that returns a set of composite type tweet and uses the twey module to fetch the last 20 tweets (demoed live). Shows creating triggers that call out to the Twitter API on insert, using PL.pypi’s plpy execute/prepare API, psycopg extras dict cursors for Flask long-polling event streams, notes that PL/Python runs in the server process, needs superuser to define untrusted functions, and that the demo works end-to-end.
AI-written summary · about
chapters (8)
- 0:00Introduction to PL/Python
- 4:44Extension and Untrusted Code
- 10:21Set Returning Functions
- 16:01Using the SD Object
- 22:15Database Triggers
- 30:49Building the Presentation
- 38:04Live Updates and Polling
- 45:15Q&A and Best Practices
related talks
43mPL/Python -- Python inside the PostgreSQL RDBMS
31mExtending SQL Databases with Python
49mPostgreSQL - the database-sister of Python
24mDeveloping DB Extensions in Python: Examples for SQLite, DuckDB & PostgreSQL
30mBuilding modern Python web apps with PostgreSQL
41mMassively Parallel Processing with Procedural Python
25mPostgres and the Artificial Intelligence Landscape
45mPostgres and the Artificial Intelligence
