A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/070973.html below:

ANN: plpython - python integration with postgresql RDBMS

ANN: plpython - python integration with postgresql RDBMS ANN: plpython - python integration with postgresql RDBMSChristopher Lee clee at gnwy100.wuh.wustl.edu
Thu Apr 12 10:46:46 EDT 2001
FYI:

Andrew Bosma is working on integrating python with postgresql in order to
allow the use of python as a built-in procedural language for database
functions as you would with PL/pgSQL.  It's a work-in-progress but it looks
pretty cool and he's looking for feedback.  Source is available from
http://users.ids.net/~bosma/.  I would say these are "developer" releases:
compilation is a little tricky and may require that you build postgresql
7.1RC1 yourself.

-chris

To elaborate, plpython allows you to embed python into functions using the
form:

CREATE FUNCTION <function_name>(..) RETURNS <return_type> AS
<insert arbitrary python code>
LANGUAGE 'plpython'


For example, if you have a database which needs to maintain hashes of email
messages you might create a function like this:


CREATE FUNCTION handle_digest(text) RETURNS text
	AS
'import sha
digest = sha.new(args[0])
return digest.hexdigest()' LANGUAGE 'plpython';

You could then create a trigger that called this function to update the
hash using the CREATE TRIGGER.



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4