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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-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

Browse pgsql-interfaces by date

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

Browse pgsql-novice by date

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