Questions tagged [rpostgresql]

An R interface to the PostgreSQL database system

RPostgreSQL is an package providing an interface to databases. RPostgreSQL uses the interface which is also used by the packages , , , and .

Repositories

Other resources

Related tags

210 questions
1
vote
1 answer

what is the theory of connecting R to Redshift using RPostgreSQL and dplyr

I just know how to connect R to Redshift using RPostgreSQL and dplyr. But I am confused about a couple of things: When I want to show something on the screen, like head(a) where a is a result retrieving from Redshift, it is gonna be really slow.…
Feng Chen
  • 2,139
  • 4
  • 33
  • 62
1
vote
2 answers

How do I write a single row of data into a postgresql table from R?

I have a table myschema.fruits in a postgresql database mydatabase. From within an R script I would like to insert a single row to that table, at the end os my script. The table row has 3 columns type, taste and color. Those I have in 3 different…
Niels Kristian
  • 8,661
  • 11
  • 59
  • 117
1
vote
0 answers

RPostgreSQL can't connect

I'm having trouble connecting my R client to redshift through the RPostgreSQL package, despite it working very easily through psql. I've tried downloading and sourcing the redshift-ssl-ca-cert.pem file, but this still doesn't seem to work. Any ideas…
jtanman
  • 654
  • 1
  • 4
  • 18
1
vote
0 answers

How to subset a remote tbl in r?

I have loaded a sql table to a tbl using dplyr (rr is my db connection) : s_log=rr%>%tbl("s_log") then extracted three columns and put them in a new tbl : id_date_amount=s_log%>%select(id,created_at,amount) when i run head (id_date_amount) it…
chessosapiens
  • 3,159
  • 10
  • 36
  • 58
1
vote
0 answers

Error loading huge CSV files into postgresql from R

I have about 10,000 csv files that I am trying to import into Postgres. The csv file size ranges from about 500MB to 1GB each. I'm importing each file into R first as a data frame because I have to do a bit of preprocessing on the raw data (like…
let_there_be_light
  • 837
  • 3
  • 9
  • 15
1
vote
1 answer

Can not connect PostgreSQL(over SSL) with RPostgresql on Windows

I can not connect PostgreSQL(on Heroku) with RPostgreSQL on Windows(64bit). I can connect local postgresql(not ssl) with RPostgreSQL on Windows. I can connect PostgreSQL on Heroku from PgAdmin on Windows. I can connect PostgreSQL on Heroku with…
Jaehyun Shin
  • 1,562
  • 14
  • 25
1
vote
1 answer

Integrating java with R using renjin

I want to connect R to postgresql through Renjin for which I am using engine.eval("library(RPostgreSQL)"); getting folllowing error org.springframework.web.util.NestedServletException: Request processing failed; nested exception is…
Raaj
  • 31
  • 5
1
vote
1 answer

R fails to write table to PostgreSQL via rPostgreSQL

I am new to PostgreSQL and I'm trying to use R to write table to PostgreSQL. See the R code below; make some reproducible data frame first: > Time<-c('201512', '201511', '201510') > Department<-c('ABC', 'BCA', 'NBA') > Pro_Type<-c('standard',…
Samoth
  • 716
  • 15
  • 34
1
vote
1 answer

Redshift with R

I am new to connecting to Redshift via R, I have read other questions but am still getting an error when I attempt to create a table. I have successfully set up a connection and I thought set up the table successfully: redshiftcon <- dbConnect(mm,…
RCN
  • 671
  • 1
  • 5
  • 17
1
vote
1 answer

PostgreSQL - How to decrease select statement excution time

My Postgres version: "PostgreSQL 9.4.1, compiled by Visual C++ build 1800, 32-bit" The table which i am going to deal with; contains columns eventtime - timestamp without timezone serialnumber - character varying(32) sourceid - integer and 4…
Chanti
  • 525
  • 1
  • 5
  • 15
1
vote
2 answers

skip the empty dataframes and produce the output

sessionInfo() R version 3.2.0 (2015-04-16) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 [3]…
Chanti
  • 525
  • 1
  • 5
  • 15
1
vote
1 answer

R infinity dates mixed with text

I'm trying to account for infinite dates in PostgreSQL in a way that corresponds with the infinite date values described in this question. However, I can't get the code to work quite right. df <- data.frame(dates = c("2012-08-06", "2014-05-05",…
TuringMachin
  • 391
  • 1
  • 4
  • 10
1
vote
1 answer

RPostgreSQL dbConnect using connection string

Using the RPostgreSQL package, is there a way to connect to a remote PostgreSQL instance other than hardcoding the credentials into the dbConnect method? As far as I can tell, this is the only way to do it: dbConnect(drv, host='some.com',…
yalestar
  • 9,334
  • 6
  • 39
  • 52
1
vote
1 answer

How to import data frame with character column (RPostgreSQL)?

I have a problem with import table using RPostgreSQL. I mean, one column is bigint format, and when I create simple query: df<- dbGetQuery(con, " SELECT euid FROM table LIMIT 5;") I…
Nicolabo
  • 1,337
  • 12
  • 30
1
vote
0 answers

R 3.1.1 on Windows - Connecting from Outside of Amazon EC2—Firewall Timeout Issue

I'm currently playing around with accessing AWS Redshift through R via the RPostgreSQL package. Everything works fine until I try to submit more complex queries which take longer to run. When submitting these queries the connection times out as…
Koen Michiels
  • 93
  • 1
  • 6