Re: python modul pre-import to avoid importing each time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Rémi Cura <remi(dot)cura(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: python modul pre-import to avoid importing each time
Date: 2014-06-26 18:17:19
Message-ID: 42670.1403806639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
> On 06/26/2014 02:14 AM, Rmi Cura wrote:
>> On another internet page (can't find it anymore) somebody mentioned this
>> module loading at server startup, one way or another, but gave no
>> precision. It seems that the "plpy" python module get loaded by default,
>> would'nt it be possible to hack this module to add other import inside it?

> In a sense that is what is being suggested above.

IIRC, plperl has a GUC you can set to tell it to do things at the time
it's loaded (which of course you use in combination with having listed
plperl in shared_preload_libraries). There's no reason except lack of
round tuits why plpython couldn't have a similar feature.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Anand Kumar, Karthik 2014-06-26 20:03:48 Repeated semop calls
Previous Message Jeff Janes 2014-06-26 18:16:53 Re: python modul pre-import to avoid importing each time