Giter VIP home page Giter VIP logo

plr's People

Contributors

davecramer avatar jconway avatar petere avatar swuecho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plr's Issues

Error building rpm with given spec file

I tried creating the plr rpm with the given spec file but got the following error:

Processing files: plr-8.3.0.15-1.el6.x86_64
error: File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/doc/README.plr
error: File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr.sql
error: File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr.control
error: File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr--8.3.0.15.sql
error: File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr--unpackaged--8.3.0.15.sql


RPM build errors:
    File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/doc/README.plr
    File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr.sql
    File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr.control
    File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr--8.3.0.15.sql
    File not found: /u/users/jcragun/rpmbuild/BUILDROOT/plr-8.3.0.15-1.el6.x86_64/usr/share/pgsql/extension/plr--unpackaged--8.3.0.15.sql

I'm building on

$ cat /etc/*-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)

The plr.control file is not installed anywhere during make install. Because of that, I removed the following line in plr.spec

%{_datadir}/pgsql/extension/plr.control

I then noticed the install location for a few of the files is different than what's in the spec. So I modified their paths.

%doc %{_docdir}/pgsql/contrib/README.plr
%{_datadir}/pgsql/contrib/plr.sql
%{_datadir}/pgsql/contrib/plr--8.3.0.15.sql     
%{_datadir}/pgsql/contrib/plr--unpackaged--8.3.0.15.sql

Is this an issue with the spec file or am I missing something? Perhaps this issue only occurs on Red Hat.

path of pg_config is required.

USE_PGXS=1 make
USE_PGXS=1 make install

in http://www.joeconway.com/plr/doc/plr-install.html is not good enough.

have to set the right pg_config path

PATH=/usr/pgsql-9.4/bin/:$PATH; USE_PGXS=1 make
echo 'PATH=/usr/pgsql-9.4/bin/:$PATH; USE_PGXS=1 make install' | sudo sh

although, it is not hard to figure out.

If the manual can be more informative, it will be great.

Window function performance seems lacking.

The performance of PL/R window functions is fairly poor. By building the "windows" by hand and pass them to R as vectors, I can get much better performance. Would it be possible for PL/R to use a similar approach to constructing windows?

The two queries below give the same results, but the first takes 37 seconds and the second 6 seconds. The performance of the second is even better (about 3 seconds) if I eliminate the extra array_agg/unnest steps I'm taking to be able to keep track of the data.

Query 1:

Here is a window function

CREATE OR REPLACE FUNCTION public.winsorize(
    double precision,
    double precision)
  RETURNS double precision AS
$BODY$
	library(psych)
	return(winsor(as.vector(farg1), arg2)[prownum])
$BODY$ LANGUAGE plr WINDOW ;

Here is a query using this window function:

WITH raw_data AS (
	SELECT gvkey, datadate, date_part('year', datadate) AS year,
	    CASE WHEN lag(ceq) OVER w > 0 THEN ni/lag(ceq) OVER w END AS roe
	FROM comp.funda
	WINDOW w AS (PARTITION BY gvkey ORDER BY datadate)
	ORDER BY gvkey, datadate
	LIMIT 100000)

SELECT year, gvkey, datadate, roe,
    winsorize(roe, 0.05) OVER (PARTITION BY year) AS roe_w
FROM raw_data
WHERE roe IS NOT NULL
ORDER BY year, roe;

Query 2:
Here is an alternative version of the query above in which the "windows" are constructed by hand.

WITH raw_data AS (
	SELECT gvkey, datadate, date_part('year', datadate) AS year,
	    CASE WHEN lag(ceq) OVER w > 0 THEN ni/lag(ceq) OVER w END AS roe
	FROM comp.funda
	WINDOW w AS (PARTITION BY gvkey ORDER BY datadate)
	ORDER BY gvkey, datadate
	LIMIT 100000),

intermediate AS (
    SELECT year, 
	array_agg(gvkey ORDER BY roe) AS gvkeys,
	array_agg(datadate ORDER BY roe) AS datadates,
	array_agg(roe ORDER BY roe) AS roes,
	winsorize_vec(array_agg(roe ORDER BY roe), 0.05) AS roe_ws
    FROM raw_data
    WHERE roe IS NOT NULL
    GROUP BY year)

SELECT year, unnest(gvkeys) AS gvkey,
    unnest(datadates) AS datadate,
    unnest(roes) AS roe,
    unnest(roe_ws) AS roe_w
FROM intermediate
ORDER BY year, roe;

The query is using this function:

CREATE OR REPLACE FUNCTION public.winsorize_vec(
    float8[],
    double precision)
  RETURNS float8[] AS
$BODY$
	library(psych)
	return(winsor(as.vector(arg1), arg2))
$BODY$ LANGUAGE plr; 

One idea I had was to create an SQL function like this:

CREATE OR REPLACE FUNCTION public.winsorize_sql(
    double precision,
    double precision)
  RETURNS double precision AS
$BODY$
     SELECT unnest(winsorize_vec(array_agg($1), $2))
$BODY$ LANGUAGE sql WINDOW 

This compiles and I can use it in a query, but I get NULL as the return value every time.

Does PL/R work with PostgreSQL 9.4?

Joe:

Does PL/R work with PostgreSQL 9.4?

I looked into upgrading my server to 9.4 to get access to some JSON functions that are precisely what I was looking for today, but pg_upgrade won't let me do it without PL/R (I'd want that anyway). I complile PL/R fine, but when I go to upgrade I get the following error message:

Could not load library "$libdir/plr"
ERROR:  could not load library "/opt/local/lib/postgresql94/plr.so": dlopen(/opt/local/lib/postgresql94/plr.so, 10): Symbol not found: _MemoryContextSwitchTo
  Referenced from: /opt/local/lib/postgresql94/plr.so
  Expected in: /opt/local/lib/postgresql94/bin/postgres
 in /opt/local/lib/postgresql94/plr.so

Thanks.

-Ian

Out arguments don't work:

Returning a data through data.frame via an explicit composite type seems to work ok, but any function that used OUT variables seemed to fail with:

ERROR: proargnames must have the same number of elements as the function has arguments

That may be working as intended, but I though it's worth noting.

Work Around Solution Found: pl/r does not run on Windows 10 64 bit and *new* hardware

I tried

Win64 plr.dll for Postgres 9.5.x, R-3.3.0 (plr-8.3.0.16)

on

 PostgreSQL 9.5.2, compiled by Visual C++ build 1800, 64-bit

with

R version 3.3.1 (2016-06-21)  Platform: x86_64-w64-mingw32/x64 (64-bit)

on a new-ish Windows 10 64 bit laptop that is only 18 months old.

I am getting this error again.

postgres=# select r_max(5,3);
ERROR:  could not open file "base/12373/2663": No such file or directory
LINE 1: SELECT NULL FROM pg_catalog.pg_class WHERE relname 'plr_modules' AND relnamespace = 2200

So, my 'old hardware' guess is wrong.

pl/r runs fine on Windows 7 64 bit

What is the easiest way ( or an easy way ) to try to debug this problem?

travis-ci build and test workflow

Would be nice to have travis-ci build and test workflow, or at least the build part.
User would have a live deploy documentation.

plr AND PostgreSQL 9.5

I'm running postgres 9.5 on windows 10.
I downloaded plr 8.3.0.16.
I followed instructions about configuration of enviroment variables according to the file install.txt included in the zip.

When I try to create extension plr in my database I get the following error:

ERROR: incompatible library "C:/Program Files/PostgreSQL/9.5/lib/plr.dll": version mismatch
DETAIL: Server is version 9.5, library is version 9.4.

********** Error **********

ERROR: incompatible library "C:/Program Files/PostgreSQL/9.5/lib/plr.dll": version mismatch
SQL state: XX000
Detail: Server is version 9.5, library is version 9.4.

wrong type of text crashes the server

I have a function that crashes my postgres 9.5 server. Here is the PL/R function:

CREATE OR REPLACE FUNCTION test_svg () RETURNS text AS
$$
library("svglite")
library("ggplot2")

# set up to output svg to a string
s = svgstring()

# create the plot, as an example
ggplot(mapping = aes(cars$speed)) + geom_density()

# NOTE: this works:
# plot(density(cars$speed))

# fetch the string
svg = s()

# turn off output to the string
dev.off()

return(svg)
$$
LANGUAGE 'plr' IMMUTABLE;

When I run this, the whole server crashes, and all connections are dropped. Here is the main part of the error message in my postgresql logs:

Error: CHAR() can only be applied to a 'CHARSXP', not a 'pairlist'
*** stack smashing detected ***: postgres: postgres c7_70 [local] SELECT terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7fc78c616b37]
/lib64/libc.so.6(__fortify_fail+0x0)[0x7fc78c616b00]
/usr/lib64/R/lib/libR.so(+0x1412d1)[0x7fc73f2182d1]

Curiously, if I simply remove the return(svg) statement and instead do return("foo"), it works fine (but of course I don't get the output I want). So somehow the process of returning the svg string and coercing it to the postgresql text causes a hard crash. It is also odd to me that the regular old "plot" works just fine. Maybe that means this is a bug in svglite or ggplot2, but it would be nice if PL/R prevented server crashes as much as possible. Maybe it is something about the svg generated by ggplot2 that causes the problem.

As a side note, I am new to PL/R but find it confusing how returning text often fails. For example, if I have two strings and concatenate them, no dice. That is, this doesn't work:

CREATE OR REPLACE FUNCTION R_test_cat () RETURNS text AS $$ return(cat("foo","bar")) $$ language 'plr';

When running this I get nothing, whereas a simple return("foo bar") works just fine. If there is something I am doing wrong in either of these cases please advise. Thanks, and appreciate the efforts on PL/R, it is a very useful module.

unable to load certain libraries in plr Windows 10

I am unable to load certain libraries in plr in windows 10.
They fail with the following error message:

ERROR:  R interpreter expression evaluation error
DETAIL:  Error: package or namespace load failed for '[libname]'
CONTEXT:  In PL/R function export

Libraries so far that I found to fail are: reshape, reshape2, lattice, hexbin, testthat, Matrix
These libraries are usable from R itself.
At the same time other libraries installed the same way, and located at the same place load with no problem, eg: curl, foreach, MASS, knitr, yaml

I am running

Postgres 9.4 on Windows 10
R - 3.3.1
dir: C:\Program Files\R\R-3.3.1\library
R_HOME from Select * From plr_environ() is C:\Program Files\R\R-3.3.1

I also tried this with Postgres 9.5 and got the same error.
There is no similar problem on my production Debian machine.
I don't even know where to begin investigating.

(I have sent this same message to the mailing list as well. I am sorry for double posting but I am uncertain now what forum should I be using for issues.)

Thanks for any help.
Balázs

crash on bogus return statement (?)

Trying out pl/r for the very first time, I was able to elicit a crash :-). R function:

mpf2=# CREATE OR REPLACE FUNCTION REcho(float8[]) RETURNS SETOF float8 AS
mpf2-# $$
mpf2$# return
mpf2$# $$ LANGUAGE plr;
CREATE FUNCTION
Time: 16.000 ms
mpf2=#
mpf2=#
mpf2=# select recho(array[1.0, 2.0]);
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.

The server log gave:
2012-08-29 15:42:57 CDT [rms@mpf2]: ERROR: cannot cast type integer to double precision[] at character 12
2012-08-29 15:42:57 CDT [rms@mpf2]: STATEMENT: select 1324::_float8;
Error: cannot coerce type 'special' to vector of type 'character'
Error: use of NULL environment is defunct

*** caught segfault ***
address (nil), cause 'memory not mapped'
aborting ...
2012-08-29 15:49:46 CDT [@]: LOG: server process (PID 31168) was terminated by signal 11: Segmentation fault
2012-08-29 15:49:46 CDT [@]: LOG: terminating any other active server processes

sample_numeric_data

I have started to experiment with PL/R, and admittedly new to both Postgresql and PL/R.

Just wondering where I can find the sample_numeric_data table data used in PL/R presentations online, so I can follow along the examples. thanks!

installation fails on 9.2 due to tightened create function casing rules

As of postgresql 9.2, you can longer create functions with as language 'C' (you can do 'c' or C). To me, this is an inexplicable compatibility break (I was halfway through submitting a gripey bug report before changing my mind).

Attached patch (vs 8.3.0.13) should fix:
Common subdirectories: plr/doc and plr_fixed/doc
Common subdirectories: plr/expected and plr_fixed/expected
diff -c plr/plr--8.3.0.13.sql plr_fixed/plr--8.3.0.13.sql
*** plr/plr--8.3.0.13.sql 2011-08-29 17:42:56.000000000 -0500
--- plr_fixed/plr--8.3.0.13.sql 2012-10-03 08:22:52.865124218 -0500


*** 2,47 ****

CREATE FUNCTION plr_call_handler()
RETURNS LANGUAGE_HANDLER
! AS 'MODULE_PATHNAME' LANGUAGE C;

CREATE LANGUAGE plr HANDLER plr_call_handler;

CREATE OR REPLACE FUNCTION plr_version ()
RETURNS text
AS 'MODULE_PATHNAME','plr_version'
! LANGUAGE 'C';

CREATE OR REPLACE FUNCTION reload_plr_modules ()
RETURNS text
AS 'MODULE_PATHNAME','reload_plr_modules'
! LANGUAGE 'C';

CREATE OR REPLACE FUNCTION install_rcmd (text)
RETURNS text
AS 'MODULE_PATHNAME','install_rcmd'
! LANGUAGE 'C' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION install_rcmd (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_singleton_array (float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array'
! LANGUAGE 'C' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_push (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_push'
! LANGUAGE 'C' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_accum (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_accum'
! LANGUAGE 'C';

CREATE TYPE plr_environ_type AS (name text, value text);
CREATE OR REPLACE FUNCTION plr_environ ()
RETURNS SETOF plr_environ_type
AS 'MODULE_PATHNAME','plr_environ'
! LANGUAGE 'C';

REVOKE EXECUTE ON FUNCTION plr_environ() FROM PUBLIC;

--- 2,47 ----

CREATE FUNCTION plr_call_handler()
RETURNS LANGUAGE_HANDLER
! AS 'MODULE_PATHNAME' LANGUAGE c;

CREATE LANGUAGE plr HANDLER plr_call_handler;

CREATE OR REPLACE FUNCTION plr_version ()
RETURNS text
AS 'MODULE_PATHNAME','plr_version'
! LANGUAGE 'c';

CREATE OR REPLACE FUNCTION reload_plr_modules ()
RETURNS text
AS 'MODULE_PATHNAME','reload_plr_modules'
! LANGUAGE 'c';

CREATE OR REPLACE FUNCTION install_rcmd (text)
RETURNS text
AS 'MODULE_PATHNAME','install_rcmd'
! LANGUAGE 'c' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION install_rcmd (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_singleton_array (float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array'
! LANGUAGE 'c' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_push (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_push'
! LANGUAGE 'c' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_accum (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_accum'
! LANGUAGE 'c';

CREATE TYPE plr_environ_type AS (name text, value text);
CREATE OR REPLACE FUNCTION plr_environ ()
RETURNS SETOF plr_environ_type
AS 'MODULE_PATHNAME','plr_environ'
! LANGUAGE 'c';

REVOKE EXECUTE ON FUNCTION plr_environ() FROM PUBLIC;


*** 78,100 ****
CREATE OR REPLACE FUNCTION plr_set_rhome (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_rhome'
! LANGUAGE 'C' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_rhome (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_unset_rhome ()
RETURNS text
AS 'MODULE_PATHNAME','plr_unset_rhome'
! LANGUAGE 'C';
REVOKE EXECUTE ON FUNCTION plr_unset_rhome () FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_set_display (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_display'
! LANGUAGE 'C' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_display (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_get_raw (bytea)
RETURNS bytea
AS 'MODULE_PATHNAME','plr_get_raw'
! LANGUAGE 'C' WITH (isstrict);

--- 78,100 ----
CREATE OR REPLACE FUNCTION plr_set_rhome (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_rhome'
! LANGUAGE 'c' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_rhome (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_unset_rhome ()
RETURNS text
AS 'MODULE_PATHNAME','plr_unset_rhome'
! LANGUAGE 'c';
REVOKE EXECUTE ON FUNCTION plr_unset_rhome () FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_set_display (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_display'
! LANGUAGE 'c' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_display (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_get_raw (bytea)
RETURNS bytea
AS 'MODULE_PATHNAME','plr_get_raw'
! LANGUAGE 'c' WITH (isstrict);

diff -c plr/plr.sql.in plr_fixed/plr.sql.in
*** plr/plr.sql.in 2011-08-29 17:42:56.000000000 -0500
--- plr_fixed/plr.sql.in 2012-10-03 08:22:09.273128501 -0500


*** 4,49 ****

CREATE FUNCTION plr_call_handler()
RETURNS LANGUAGE_HANDLER
! AS 'MODULE_PATHNAME' LANGUAGE C;

CREATE LANGUAGE plr HANDLER plr_call_handler;

CREATE OR REPLACE FUNCTION plr_version ()
RETURNS text
AS 'MODULE_PATHNAME','plr_version'
! LANGUAGE 'C';

CREATE OR REPLACE FUNCTION reload_plr_modules ()
RETURNS text
AS 'MODULE_PATHNAME','reload_plr_modules'
! LANGUAGE 'C';

CREATE OR REPLACE FUNCTION install_rcmd (text)
RETURNS text
AS 'MODULE_PATHNAME','install_rcmd'
! LANGUAGE 'C' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION install_rcmd (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_singleton_array (float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array'
! LANGUAGE 'C' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_push (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_push'
! LANGUAGE 'C' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_accum (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_accum'
! LANGUAGE 'C';

CREATE TYPE plr_environ_type AS (name text, value text);
CREATE OR REPLACE FUNCTION plr_environ ()
RETURNS SETOF plr_environ_type
AS 'MODULE_PATHNAME','plr_environ'
! LANGUAGE 'C';

REVOKE EXECUTE ON FUNCTION plr_environ() FROM PUBLIC;

--- 4,49 ----

CREATE FUNCTION plr_call_handler()
RETURNS LANGUAGE_HANDLER
! AS 'MODULE_PATHNAME' LANGUAGE c;

CREATE LANGUAGE plr HANDLER plr_call_handler;

CREATE OR REPLACE FUNCTION plr_version ()
RETURNS text
AS 'MODULE_PATHNAME','plr_version'
! LANGUAGE 'c';

CREATE OR REPLACE FUNCTION reload_plr_modules ()
RETURNS text
AS 'MODULE_PATHNAME','reload_plr_modules'
! LANGUAGE 'c';

CREATE OR REPLACE FUNCTION install_rcmd (text)
RETURNS text
AS 'MODULE_PATHNAME','install_rcmd'
! LANGUAGE 'c' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION install_rcmd (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_singleton_array (float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array'
! LANGUAGE 'c' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_push (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_push'
! LANGUAGE 'c' WITH (isstrict);

CREATE OR REPLACE FUNCTION plr_array_accum (_float8, float8)
RETURNS float8[]
AS 'MODULE_PATHNAME','plr_array_accum'
! LANGUAGE 'c';

CREATE TYPE plr_environ_type AS (name text, value text);
CREATE OR REPLACE FUNCTION plr_environ ()
RETURNS SETOF plr_environ_type
AS 'MODULE_PATHNAME','plr_environ'
! LANGUAGE 'c';

REVOKE EXECUTE ON FUNCTION plr_environ() FROM PUBLIC;


*** 80,102 ****
CREATE OR REPLACE FUNCTION plr_set_rhome (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_rhome'
! LANGUAGE 'C' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_rhome (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_unset_rhome ()
RETURNS text
AS 'MODULE_PATHNAME','plr_unset_rhome'
! LANGUAGE 'C';
REVOKE EXECUTE ON FUNCTION plr_unset_rhome () FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_set_display (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_display'
! LANGUAGE 'C' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_display (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_get_raw (bytea)
RETURNS bytea
AS 'MODULE_PATHNAME','plr_get_raw'
! LANGUAGE 'C' WITH (isstrict);

--- 80,102 ----
CREATE OR REPLACE FUNCTION plr_set_rhome (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_rhome'
! LANGUAGE 'c' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_rhome (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_unset_rhome ()
RETURNS text
AS 'MODULE_PATHNAME','plr_unset_rhome'
! LANGUAGE 'c';
REVOKE EXECUTE ON FUNCTION plr_unset_rhome () FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_set_display (text)
RETURNS text
AS 'MODULE_PATHNAME','plr_set_display'
! LANGUAGE 'c' WITH (isstrict);
REVOKE EXECUTE ON FUNCTION plr_set_display (text) FROM PUBLIC;

CREATE OR REPLACE FUNCTION plr_get_raw (bytea)
RETURNS bytea
AS 'MODULE_PATHNAME','plr_get_raw'
! LANGUAGE 'c' WITH (isstrict);

Common subdirectories: plr/sql and plr_fixed/sql

xx/prl.dll,The specified module could not be found. SQL state: 58P01

I'm following the instructions, but when i excute command: CREATE EXTENSION plr; I get following a message,
ERROR :无法加载库 "E:/APPS/POSTgresql/15/lib/plr.dll": The specified module could not be found.SQL state: 58P01.
I'm sure plr.dll is there. I can't fix it, please help.

pl/r runs fine on Windows 7 64 bit

I am running Windows 7 64 bit.

I tried this and this works fine.

64 bit Windows DLL posted, compiled against postgres 9.4.1 and R-3.1.2. 

[Plr-general] new release
http://lists.pgfoundry.org/pipermail/plr-general/2015-February/000902.html

I have not tried this.

64 bit Win7 DLL compiled against postgres 9.3.0 and R-3.0.2:
http://www.joeconway.com/plr/plr-8.3.0.15-pg9.3-win64.zip

Plr-general] To compile PL/R on Windows 
http://lists.pgfoundry.org/pipermail/plr-general/2013-October/000810.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.