Re: BUG #13823: Database crash - import requests in plpython3u

From: George Wesington <george(dot)wesington(at)gmail(dot)com>
To: Terje Elde <terje(at)elde(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13823: Database crash - import requests in plpython3u
Date: 2015-12-18 13:17:24
Message-ID: 56740764.3050904@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Terje,

Thank you for your reply!

The information i submitted was while running the function as postgres
user (database owner).
I can run simple python scripts and I can also import some other modules
without crashing (logging, sys, string, subprocess...)
Python was installed from the executable installer downloaded from the
official pages, same goes for postgres (from edb). Requests were
acquired with pip ( 'pip install requests').
The requests module does not even have to be used in the code, as soon
as the "import requests" statement is written in any script, the
database crashes.

Python 2 is not connected to postgres as I was actually not able to do
it. I noticed that in distribution I downloaded there is no plpython2
dll to connect postgres with it? Is there another way to do it?

Best,
George

On 18/12/2015 06:59, Terje Elde wrote:
>
>> On 17 Dec 2015, at 14:34, george(dot)wesington(at)gmail(dot)com wrote:
>>
>> After the crash the database needs to be restarted because it cannot be
>> accessed anymore. The same script runs perfectly when run directly from
>> python.
>>
>> Let me know if you need any more information.
> Could you try to run it as the PostgreSQL user, but outside PostgreSQL?
>
> Also, please double check that it's run as Python 3 when testing that. The code looks fairly compatible between 2.7 and 3.x, and my best initial guess would be that Python crashes on a missing or faulty import.
>
> Can you successfully run a simpler Python function from PostgreSQL? (One that doesn't import anything). Easy way to narrow down if it's likely the requests-module in Python, or if it's related to plpython.
>
> Oh, and how did you install Python, PostgreSQL, plpython and the requests module?
>
> Terje
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andreas Rhode 2015-12-18 14:25:26 to_date() not works as described for pattern DD & HH
Previous Message Thomas Munro 2015-12-18 11:20:00 Re: Known issues on PostgreSQL server 8.1.19