I want to update a table in PostgreSQL table from a newData dataframe in local through a loop when the id matches in both tables. However, I encountered issues that the text values do not update exactly as our newData to the database. Number is…
I'm trying to connect from RStudio on my Mac to a PostgreSQL database.
The following code chunk works successfully on the Windows and Mac RStudio installs of my colleagues.
blah.blah.rds.amazonaws.comblah.blah.rds.amazonaws.com"
dbport <-…
I have the following dataframe:
library(rpostgis)
library(RPostgreSQL)
library(glue)
df<-data.frame(elevation=c(450,900),
id=c(1,2))
Now I try to upload this to a table in my PostgreSQL/Postgis database. My connection (dbConnect) is…
I connect to a PostgreSQL DB via RPostgres to perform queries.
My current workflow is the following:
In the terminal, I create a tunnel via ssh.
ssh -L PORT:host:25060
On top of my R script, I create the DB connection:
# use RPostgres…
at work we have a database to which the following series of commands connected me from R.
library(RPostgreSQL)
drv <- dbDriver("PostgreSQL")
con <- DBI::dbConnect(
drv = drv,
host = "rocket.cluster-east-1.rds.amazonaws.com",
user = "…
I am trying to write a table into my data warehouse using the RPostgreSQL package
library(DBI)
library(RPostgreSQL)
pano = dbConnect(dbDriver("PostgreSQL"),
host = 'db.panoply.io',
port = '5439',
…
I've been trying to solve a problem with the RPostgreSQL package for quite some time. My code:
path_ene <- "C:/Users/omen03/ENE"
nene <- "ene_2010_02_efm.csv"
drv <- dbDriver("PostgreSQL")
con = dbConnect(drv, user="postgres",…
Im currently working on my shiny app, and what im dealing with now is viewing return message from SQL function on shiny app, after using this function.
Here is my function:
CREATE OR REPLACE FUNCTION delivery(s_i INTEGER, n INTEGER, q INTEGER,…
I have the following query:
query <- 'SELECT field1, field2
from mytable
where field1 IN $1
AND field2 <= $2
ORDER BY field1 ASC, field2 DESC;'
params <- list(list('A','B'), as.character(as.POSIXlt(Sys.time(), tz="UTC")))
print(params)
I run:
df…
I am attempting to connect to Redshift using the RPostgres package.
Normally this works fine, however I am using VPN to connect to my companies network.
Running the following, with placeholders for sensitive info obviously:
library(RPostgres)
con…
I am having an issue in using the RPostgres package to connect with Redshift. I am unsure if it is an issue with our database set up, or if it is a known issue with the package.
I am getting different results when I use the same exact query in…
For example, if I’m presented with a PostgreSQL database, what am I missing out on by using RPostgreSQL to interface with it instead of executing SQL operations using the command line or a database management application? Are there some things that…
I am trying to connect to a external database (PostgresSQL) from Rstudio by using DBI and RPostgres. I defined all parameters:
con <- DBI::dbConnect(RPostgres::Postgres(),
dbname = 'name',
host =…
I have a udf in postgres that expects array as input argument. Example:
create or replace function vwap(prices numeric[], volume integer[])
I have the prices and volume stored in a R data.table.
dt <- data.table(prices = numeric(), volume =…
Unless I'm missing something there is no reference in documentation to how to use functions such as db_write_table in practice. The only reference in package documentation is.
db_write_table(con, table, types, values, temporary = FALSE, ...)
types…