calling Postgresql stored procedure

Nikita the Spider NikitaTheSpider at gmail.com
Wed May 30 23:09:56 EDT 2007


In article <1180516688.022056.70220 at q69g2000hsb.googlegroups.com>,
 Alchemist <alextabone at gmail.com> wrote:

> I am using Python 2.4 and Postgresql 8.2 database server.
> 
> On the database I have created a stored function, example,
> CREATE OR REPLACE FUNCTION calculateaverage()
> 
> I created a new python script and would like to call my database
> stored function.
> 
> How can I call a database stored function/procedure in python?

You need a layer in between Python and Postgres so that they can talk to 
one another. If you don't have one, try this one (use version 2, not 
version 1.x):
http://www.initd.org/tracker/psycopg

Good luck

-- 
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more



More information about the Python-list mailing list