Darrel,
Hah. Well you managed to find Environment Variables so can't be that much of an idiot. Takes me ages to find it since they keep on moving it on whatever windows version I am on. One other thing to verify? Do you have the R_HOME variable set? Should be set to - C:\Program Files\R\R-3.2.2 And it should be set in the System section instead of User section. Though mine is set in User section since I have PostgresQL running under a privileged account so it can access other computer network resources. The SELECT * FROM r_typenames(); Takes 47-62 ms on my windows 2012 R2 server and returns: 194 rows I just noticed something really odd though. If I run it in pgAdmin Query window it runs fine and returns ABSTIMEOID;702 ACLITEMOID;1033 : : But then I tried rerunning in psql to get a nicer output, and got this ERROR: R interpreter expression evaluation error DETAIL: Error in data.frame(typename = x, typeoid = y) : arguments imply differing number of rows: 0, 1 CONTEXT: In PL/R function r_typenames Then I tried again in pgAdmin guessing it might be the paging in psql that is tripping, and voila, if I do SELECT * FROM r_typenames() LIMIT 10; In pgAdmin query window, I also stumble on the error. So something is definitely fishy there and you might be just really good at tripping on bugs :) BTW the list for PL/R questions is - http://lists.pgfoundry.org/mailman/listinfo/plr-general Though I thought most things were moving away from pgFoundry since pgFoundry will be retired soon, so the list might be in flux. Thanks, Regina From: postgis-users [mailto:[email protected]] On Behalf Of Darrel Maddy Sent: Sunday, November 08, 2015 12:50 PM To: PostGIS Users Discussion <[email protected]> Subject: Re: [postgis-users] New day, new problem - now with pl/r Dear Regina, The path is set to C:\Program Files\R\R-3.2.2\bin\x64\ and it is picking this up as this is shown in the output from the SELECT * FROM plr_environ(); The service has been restarted several times. I am running postgres 9.4.4 build 1800 64bit and plr 8.0.3.16. Strangely I have the same issue on both my laptop and workstation. As you have no issues I have clearly done something wrong (it seems your idiot proof guide may not be idiot proof!). I will take a fresh look and try to see where I have gone wrong. How long should the query take? Best wishes Darrel From: postgis-users [mailto:[email protected]] On Behalf Of Paragon Corporation Sent: 8 November, 2015 5:30 PM To: 'PostGIS Users Discussion' <[email protected] <mailto:[email protected]> > Subject: Re: [postgis-users] New day, new problem - now with pl/r Darrel, Hmm that would suggest you might have the R-path wrong. Those statements should all be pretty fast As noted in article, If you are running R version 2.12 or above on Windows, the R bin folder has changed. Instead of bin it's bin\i386 or bin\x64 Also you want to make sure you restart postgres service after setting the environment variables, since it doesn't take effect until relaunch. Which version of R are you running? I'm running R 3.2.2 x64 with PostgreSQL 9.4.5, compiled by Visual C++ build 1800, 64-bit and plr 8.3.0.16 It's possible things have changed since I installed, but all those commands work pretty fast on my database. Thanks, Regina http://www.postgis.us http://postgis.net From: postgis-users [mailto:[email protected]] On Behalf Of Darrel Maddy Sent: Sunday, November 08, 2015 10:23 AM To: PostGIS Users Discussion <[email protected] <mailto:[email protected]> > Subject: [postgis-users] New day, new problem - now with pl/r Dear all, Not sure if this is the right place to ask this but. I have just installed the plr extension using the instructions given here: http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgresql_plr_tu t01 Setting both the path and R_Home variables. The extension shows up in PGAdmin for this database. I tried to check the installation using the suggested commands SELECT * FROM plr_environ(); SELECT load_r_typenames(); SELECT * FROM r_typenames(); SELECT plr_array_accum('{23,35}', 42); The first of these runs but the second command seems to go into an endless loop (I stopped this after one hour- I assume it should not take that long?). I assume the failure to finish means there is a problem seeing the r typenames? As it does not fall over there is no error message to help. I am open to any suggestions how to proceed. Darrel
_______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/postgis-users
