Re: pl/R problem - Mailing list pgsql-general

From Don Isgitt
Subject Re: pl/R problem
Date
Msg-id 44EC66CE.3030109@soundenergy.com
Whole thread Raw
In response to pl/R problem  (Don Isgitt <djisgitt@soundenergy.com>)
List pgsql-general
Adam Witney wrote:
> Don Isgitt wrote:
>
>> Michael Fuhr wrote:
>>
>>> On Tue, Aug 22, 2006 at 04:24:46PM -0500, Don Isgitt wrote:
>>>
>>>
>>>> gds2=# create function sd(_float8) returns float as '' language 'plr';
>>>> CREATE FUNCTION
>>>>
>>>> gds2=# select round(sd('{1.23,1.31,1.42,1.27}'::_float8)::numeric,8);
>>>> server closed the connection unexpectedly
>>>>        This probably means the server terminated abnormally
>>>>        before or while processing the request.
>>>> The connection to the server was lost. Attempting reset: Failed.
>>>>
>>>> Relevant server log piece:
>>>>
>>>> cannot find system Renviron
>>>> Fatal error: unable to open the base package
>>>>
>>>> LOG:  server process (PID 6792) exited with exit code 2
>>>>
>>>>
>>> I can reproduce this on Solaris 9 with PL/R 0.6.2-alpha and R 2.2.1
>>> if I rename $R_HOME/etc/Renviron to something else.  I don't get
>>> the "unable to open the base package" error but I do get "cannot
>>> find system Renviron" and several other errors like "Error in
>>> options(...) : invalid editor parameter" followed by a segmentation
>>> fault.
>>>
>>>
>>>
>>>> So, the question: what am I missing that enables it to find the
>>>> "Renviron"
>>>>
>>>>
>>> Does the file $R_HOME/etc/Renviron or $R_HOME/etc/<architecture>/Renviron
>>> exist and have permissions such that the PostgreSQL server can read
>>> it?  The error "cannot find system Renviron" comes from the R
>>> function process_system_Renviron() in src/main/Renviron.c in response
>>> to process_Renviron() returning 0, which it does if its filename
>>> argument is NULL or if it can't open that file.
>>>
>>>
>>>
>> Hi Michael,
>>
>> Thanks for the reply and the research. The relevant file is
>>
>> [djisgitt@prs1 R-2.3.0]$ ls -l $R_HOME/etc/Renviron
>> -rw-rw-r--    1 djisgitt djisgitt     1151 Jun  1 11:42
>> /home/djisgitt/R-2.3.0/etc/Renviron
>>
>> so I don't see that as the problem.
>>
>>
>> I use R quite a lot, so I know the installation of R itself is good, but
>> this is the first time I have tried pl/R. Also, pgsql works, so I assume
>> there is something incorrect between pgsql and R. I just don't know what!
>>
>> If you have any more suggestions, or need more information, let me know.
>>
>
> Hi Don,
>
> your functions work fine on my linux system. Just wondering, could the
> fact that your R_HOME is installed under your home directory be causing
> the problem? Postgesql will be running as a different user...
>
> adam
>
>
Hi Adam,

Thanks for checking that. There is world read access to R_HOME, so I
hope that is sufficient.

Don

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Majordomo drops multi-line Subject:
Next
From: Alvaro Herrera
Date:
Subject: Re: Majordomo drops multi-line Subject: