Currently I'm building a Shiny APP using several queries to a PostgreSQL database (mainly SELECT and INSERT statements). The application works but I'm trying to make it faster. When I compare the execution times between the same query using the…
I'm connecting and querying a PostgreSQL database through the dplyr package in R. I know I can list all the tables in the database using dbListTables(con).
But, my tables are organized into different schema. What is the easiest way I can view all of…
I have a rstudio-server docker container (R-server) and a postgres docker container (Pg), and am using rstudio-server to connect to postgres database via RPostgreSQL package. However, I can't install RPostgreSQL package on R-server, and don't want…
The table reg_data is a PostgreSQL table. It turns out to be faster to run the regressions in PostgreSQL. But, as I am running it for 100,000s of data sets, I want to do it data set by data set and append the results of each to a table.
Is there a…
I'm analyzing data from a Redshift database, working in R using a connection per dplyr - which works:
my_db<-src_postgres(host='my-cluster-blahblah.redshift.amazonaws.com', port='5439', dbname='dev',user='me', password='mypw')
mytable <- tbl(my_db,…
I'm experimenting with how to connect R with Amazon's Redshift - and publishing a short blog for other newbies.
Some good progress - I'm able to do most things (create tables, select data, and even sqlSave or dbSendQuery 'line by line' HOWEVER, I…
I know that PostgreSQL database allows to keep track of application name for each connection and it looks like application_name variable should work with RPostgreSQL, but how exactly should I do this? Adding variable application_name = "test" to…
I am trying to install R-Package RPostgreSQL, but getting the following error,
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib64/R/library/RPostgreSQL/libs/RPostgreSQL.so':
…
I'm using the RPostgreSQL 0.4 library (compiled on R 2.15.3) on R 2.15.2 under Windows 7 64-bit to interface to PostgreSQL. This works fine when connecting to my PostgreSQL databases on localhost. I'm trying to get my R code to run with a remote…
This is a new one, and I have not found any mentions of this on other stackoverflow sites.
So I am programming in R and using the RPostgreSQL package to access a Postgres 9.1.5 database. So I created the connection to the database as I would…
Below is a snippet of my code that I use in R to extract IDs from a PostgreSQL database. When I run the function I get the following warning message from R:
In result_create(conn@ptr, statement) :
Closing open result set, cancelling previous…
I have a PostgreSQL database set up with a table and columns already defined. The primary key for the table is a combination of (Id, datetime) column. I need to periodically INSERT data for different Ids from R data.table into the database. However,…
I want to pass values contained in variables as inputs to a postgresql query using R.
Currently I'm following where it gives as example:
https://db.rstudio.com/best-practices/run-queries-safely/
Using a parameterised query with DBI requires three…
I have tried several times to run parameterized SQL statements using the RPostgreSQL package in R. I was able to run parameterized statements using positional arguments, however, I have had no luck for named arguments. Is this possible in…
I can't figure out how to apply a non-case-sensitive filter query to a remote PostgreSQL table using dplyr. To demonstrate:
require(dplyr)
require(stringr)
require(RPostgreSQL)
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, dbname="mydb",…