Questions tagged [plr]

PostgreSQL support for R as a procedural language (PL).

36 questions
9
votes
2 answers

PostgreSQL procedural language "C" not found

I am trying to use the PL/R procedural language in a PostgreSQL 9.2 database. I have installed the plr language and I am trying to add it to a database. When I run the command CREATE EXTENSION plr; I get the following error: ERROR: language "C"…
yellowcap
  • 3,985
  • 38
  • 51
5
votes
1 answer

PL/R function accepting two tables as arguments

I'm struggling to find an examples of a PL/R function that could accepts two postgres tables. PL/R docs does not provide any such example. To have a working examples lets considering using merge of two postgres tables on R side. Having two tables in…
jangorecki
  • 16,384
  • 4
  • 79
  • 160
5
votes
2 answers

When running PL/R on PostgreSQL, can R handle data bigger then RAM?

When I use R open source, if not using a specific package, it's not possible handle data sets bigger than RAM memory. So I would like to know if it's possible handle big data sets applying PL/R functions inside PostgreSQL. I didn't found any…
Flavio Barros
  • 996
  • 1
  • 11
  • 29
4
votes
2 answers

Install R with shared library in OSX - liblzma library missing

Operating system: OSX El Capitan 10.11.6 (15G1004) R version: version 3.3.1 PostgreSQL 9.5.4 on x86_64-apple-darwin14.5.0, compiled by Apple LLVM version 7.0.0 (clang-700.1.76), 64-bit I would like to install PL/R on my local PostgreSQL. From…
Duccio A
  • 1,402
  • 13
  • 27
3
votes
2 answers

I am trying to convert a postgresql query to a plr function

I have a postgres query, which works fine when I run it as a query. However, I would like to convert it to pl/r and be able to dynamically input the start and end date. The SQL that works is: with date as ( select d as first_day, d + interval '1…
Bruce Wayne
  • 471
  • 5
  • 18
2
votes
1 answer

Push R code to PL/R code in postgresql database

I am trying to convert a successful R code using Rpostgresql into a PL/R code in order to avoid pushing/pulling data in and out of the postgreql database. Code is a dcast on a data.table: #libs library(RPostgreSQL); library(data.table); #…
ant1j
  • 305
  • 2
  • 18
2
votes
2 answers

Return query results into an array

The following code snippet creates three arrays, which are passed into a PL/R function. FOR s_id, s_latitude, s_longitude IN SELECT s.id, s.latitude_decimal, s.longitude_decimal FROM climate.station s WHERE s.applicable…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
2
votes
1 answer

Loading, listing, and using R Modules and Functions in PL/R

I am having difficulty with: Listing the R packages and functions available to PostgreSQL. Installing a package (such as Kendall) for use with PL/R Calling an R function within PostgreSQL Listing Available R Packages Q.1. How do you find out what…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
1
vote
1 answer

installing plr on windows

I have Postgresql 9.0 on Windows 7 (32bit) I have downloaded plr-8.3.0.13-win32 - extracted, put the dll in its place, edited the env variables and ran the plr.sql command with success. R_HOME - C:\Program Files\R\R-2.14.1\bin\i386 Path -…
SunWuKung
  • 527
  • 4
  • 16
1
vote
1 answer

returning multiple dissimilar data structures from R function in PL/R

I have been looking at various discussions here on SO and other places, and the general consensus seems that if one is returning multiple non-similar data structures from an R function, they are best returned as a list(a, b) and then accessed by the…
punkish
  • 13,598
  • 26
  • 66
  • 101
1
vote
1 answer

In R, I am trying to render plots to a byte stream rather than writing to a file

I have R on a headless linux server and I have NO write permissions to the file system. This has forced me down a path of wanting to save my pictures to a DB (PostgreSQL in this case). I have searched around for a solution, but every one I find…
TheSteve0
  • 3,530
  • 1
  • 19
  • 25
1
vote
0 answers

Pure PostgreSQL replacement for PL/R sample() function?

Our new database does not (and will not) support PL/R usage, which we rely on extensively to implement a random weighted sample function: CREATE OR REPLACE FUNCTION sample( ids bigint[], size integer, seed integer DEFAULT 1, …
Kevin M
  • 801
  • 3
  • 9
  • 14
1
vote
1 answer

How can I unserialize a model object using PL/R in Greenplum/Postgres?

Error unserializing model object in Greenplum via PL/R I store model objects in a greenplum database (the open source version) and I've successfully been able to serialize my model objects, insert them into a table in greenplum and unserialize when…
zad0xlik
  • 183
  • 1
  • 4
  • 14
1
vote
0 answers

Connect Postgres using PLR in Rstudio

I am unable to connect to Postgres in Rstudio, how can I connect Postgres in Rstudio using PL/R? Below is the code snippet I used for connecting to Postgres using R: library(RPostgreSQL) start_time <- Sys.time() #************db connection to…
1
vote
1 answer

Pl/python and Pl/r extensions in compose-for-postgresql

Good time of the day, wanted to ask if someone knows what is the way to install PostgreSQL extensions (to be exact, pl/r and pl/python) on IBM Bluemix cloud? I am running compose-postgresql database there and when I issue postgresql query such as…
1
2 3