Skip site navigation (1) Skip section navigation (2)

Re: [NOVICE] Python modules for PL/Python?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Wolfgang Keller <wolfgang(dot)keller(dot)nospam(at)gmx(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [NOVICE] Python modules for PL/Python?
Date: 2005-03-07 07:33:16
Message-ID: 20050307073316.GA23982@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-novice
On Mon, Mar 07, 2005 at 07:39:53AM +0100, Wolfgang Keller wrote:
> >> potentially dumb question: if I want to use non-standard Python modules
> >> within PL/Python, I guess I have to recompile something (plpython.dll in
> >> the /lib folder)?
> > 
> > Are you having trouble using a module from a PL/Python function?
> 
> Oops, I didn't even try to use anything non-standard...

So try something :-)  If you have problems then please report what
you did and what happened.

> I stupidly assumed that Postgres comes with its own Python interpreter
> compiled-in...?

No, at least not on Unix-like platforms.  PL/Python is a shared
object (plpython.so) that's linked against libpython, which is the
Python runtime library for whatever version of Python you have
installed.  That library should be able to find modules in the same
module search path (sys.path) that an ordinary Python program uses.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

pgsql-novice by date

Next:From: Sean DavisDate: 2005-03-07 14:12:53
Subject: Re: Getting started - Interfacing questions
Previous:From: Wolfgang KellerDate: 2005-03-07 06:39:53
Subject: Re: [NOVICE] Python modules for PL/Python?

pgsql-interfaces by date

Next:From: Moncef MezghaniDate: 2005-03-07 10:11:45
Subject: undefined reference to `SSL_new' when linking with lib-pq.a version 7.4.7-2
Previous:From: Wolfgang KellerDate: 2005-03-07 06:39:53
Subject: Re: [NOVICE] Python modules for PL/Python?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group