One of the exciting features of the Postgresql open source database engine is the ability to write stored procedures or functions in Python. Integrating python code directly into the database gives the database engine unprecedented power. For example, a function can check the server's file system to see if a file exists. This can be done on a database trigger, when a field containing a file name is added or updated, it can give the user an error if the file doesn't exist. A delete trigger can call python code to check references and delete a file from the file system if it is no longer needed. Other examples include: sending emails, FTPing files, processing data in a simpler manner then is possible using extended SQL syntax typically used in database functions.
There are tremendous advantages in writing database functions directly in Python. The ability increases the power of the database so that it is not tied down to strictly data access. In certain circumstances, it can be used as an application server, by putting your business logic inside database functions. This has to be managed correctly so that MVC principles are adhered to.
In my 45 minute talk, I will:
explain the concept of using a high level programming language integrated in the database layer.
show examples of the power it affords database programmers
show examples of using postgresql with python as an application server
show examples of abusing the power and how it should not be used.
Sign in to add slides, notes or videos to this session