Forum: PL/R Now runs on Win32 again!

Posted by: Joe Conway
Date: 2010-02-24 21:12
Summary:PL/R Now runs on Win32 again!
Project:PL/R

PL/R 8.3.0.9 was released. This version supports PostgreSQL 8.3.x, 8.4.x, and PostgreSQL 9.0 devel. Building to produce win32 binaries is once again supported using MSVC-2005.

Sponsors Ads

Latest News

PL/R Now runs on Win32 again!

Joe Conway - 2010-02-24 21:12 -

PL/R update 2009-04-18

Joe Conway - 2009-04-26 08:28 -

PL/R does Windows

Joe Conway - 2007-06-19 22:40 -

PL/R updated

Joe Conway - 2007-06-12 17:09 -
Monitor Forum | Start New Thread Start New Thread
restoring PLR [ reply ]
By: dave h on 2011-08-11 20:15
[forum:1014903]
I've been looking around and I can't seem to find any good documentation on restoring PLR installs. I was running into issues while using PLR, because I'm not l337 at system administration, and I tried re-installing PLR.

Even firing up a new database and trying to load PLR there has caused all my PLR commands to work for all test cases in the setup guide.

to be more specific:

I followed the windows install guide to the tooth. And each of the following statements runs successfully:

SELECT * FROM plr_environ();
SELECT load_r_typenames();
SELECT * FROM r_typenames();
SELECT plr_array_accum('{23,35}', 42);

The following also work:

CREATE OR REPLACE FUNCTION plr_array (text, text)
RETURNS text[]
AS '$libdir/plr','plr_array'
LANGUAGE 'C' WITH (isstrict);

select plr_array('hello','world');

Then I kept copy/pasting more code that I believed would work (this is from joe conway):

create or replace function r_median(_float8) returns float as '
median(arg1)
' language 'plr';

CREATE AGGREGATE median (
sfunc = plr_array_accum,
basetype = float8,
stype = _float8,
finalfunc = r_median
);

create table foo(f0 int, f1 text, f2 float8);
insert into foo values(1,'cat1',1.21);
insert into foo values(2,'cat1',1.24);
insert into foo values(3,'cat1',1.18);
insert into foo values(4,'cat1',1.26);
insert into foo values(5,'cat1',1.15);
insert into foo values(6,'cat2',1.15);
insert into foo values(7,'cat2',1.26);
insert into foo values(8,'cat2',1.32);
insert into foo values(9,'cat2',1.30);

SO FAR SO GOOD!

Then I get testing the function with the following suggested line:
select f1, median(f2) from foo group by f1 order by f1;

And this happens:
ERROR: R interpreter expression evaluation error
DETAIL: Error in PLR17496 <- function(arg1) { : could not find function "median"
CONTEXT: In PL/R function r_median

I tried to write other simple functions and I'm getting the same errors that I haven't the slightest clue how to fix. The strange thing is that I have a script where I created a bunch of functions, and ran them successfully the day before, but now they are all giving me errors. The only thing that comes to mind is setting the search path to point to the right schema, but I've tried to create the functions on every schema and still no dice.

I want to go back to my original plr setup, but don't know how. I just want to get to a point where functions authored by people in the know will start working.

Powered By FusionForge