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
2
votes
2 answers

R access redshift table under a schema with dplyr or RPostgreSQL

I'm trying to connect to a database in Redshift with my mac. I managed to connect to Redshift with both dplyr and RPostgreSQL, but even though i can see all the available tables regardless of schema, i'm unable to access any of them as they all are…
chrisjacques
  • 635
  • 1
  • 5
  • 17
2
votes
1 answer

using dbDriver("PostgreSQL") in R package

I'm trying to put together a small package that makes use of R's PostgreSQL package. I understand that the way to use functionality from other packages is not to use library() but to import only single functions using namespacing. I'm having a hard…
RoyalTS
  • 9,545
  • 12
  • 60
  • 101
2
votes
1 answer

RPostgreSQL loading multiple CSV files into an Postgresql table

I'm new at using Postgresql, and I'm having trouble populating a table I created with multiple *.csv files. I was working first in pgAdmin4, then I decide to work on RPostgreSQL as R is my main language. Anyway, I am dealing (for now) with 30 csv…
2
votes
0 answers

RPostgreSQL insert rows without all columns into db

I'm trying to insert rows representing some but not all columns of a Postgres database. In particular, I am seeking to insert all columns except a timestamp column that has a default set to current timestamp. I tried the…
helloB
  • 3,472
  • 10
  • 40
  • 87
2
votes
0 answers

dbDisconnect() dont close session in R

I have such problem: I cant close my session using dbDisconnect() library(RPostgreSQL) drv <- dbDriver("PostgreSQL") con <- dbConnect(drv, dbname = "dbname", user = "user", password = "password", …
Slavka
  • 1,070
  • 4
  • 13
  • 28
2
votes
1 answer

Setting up data refreshing in Shiny app connected to PostgreSQL

I've looked at this and this thread and a few others but haven't been able to figure out my solution. I have built a dashboard using R and Shiny, and said dashboard pulls in data from a Postgres db using the RPostgreSQL package. Right now, the code…
NeonBlueHair
  • 1,139
  • 2
  • 9
  • 22
2
votes
1 answer

Difference between src_postgres and dbConnect function to connect R with postgres

what is the difference between src_postgres and dbConnect function? Both can be used to connect R with postgres using the RPosgresql package. In my experiments I only could use src_postgres to read and dbConnect to write to the database. When I…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
2
votes
0 answers

Using RMySQL interferes with RPostgreSQL

I have an R script where I want to pull some data from a MySQL database, then from a PostgreSQL database. However, loading the MySQL driver from RMySQL prevents me from loading the PostgreSQL driver from PostgreSQL. I can load the Postgres driver…
Zach
  • 29,791
  • 35
  • 142
  • 201
2
votes
1 answer

R RpostgreSQL bigint datatype

I need to deal with the, I suppose the big int, primary key values 1380742793415240. In R I can easily adjust option(scipen=100) but I need to store that data in postgres db. I've already tried to dbWriteTable default (double precision) with result:…
jangorecki
  • 16,384
  • 4
  • 79
  • 160
2
votes
1 answer

R Postgres and shortcut commands?

Do postgres shortcuts like \d+ tablename work with RPostgreSQL? If I try to run 'em I get a syntax error: Error: '\d' is an unrecognized escape in character string starting "\d". I tried escape it, but did not figure it out. RPostgreSQL itself works…
Matt Bannert
  • 27,631
  • 38
  • 141
  • 207
1
vote
1 answer

Passing postgresql parameter keywords via RPostgreSQL

I would like to pass some parameter keywords (specifically keepalives, keepalives_idle, keepalives_count , or connect_timeout) using the R package RPostgreQSL to connect to my DB. I have searched the docs and stackoverflow for an implementation, but…
Chris
  • 199
  • 9
1
vote
0 answers

Cannot connect to Postgres database from RStudio but can connect from DBeaver and psql

Can connect to the database from psql and DBeaver but when using RpostgreSQL package in RSudio I receive the following error: RPosgreSQL error: could not connect user@hostname on dbname "database": FATAL: no pg_hba.conf entry for host "", user…
Ct14
  • 11
  • 1
1
vote
1 answer

RPostgreSQL - SCRAM error when trying to connect to local database

I am trying to connect to my localhost postgres DB and I get the following error. library("RPostgreSQL") drv <- dbDriver("PostgreSQL") connec <- dbConnect(drv, dbname = "dbnamehere", port = 5432,user = "some_username", password =…
user3507584
  • 3,246
  • 5
  • 42
  • 66
1
vote
0 answers

Handling passwords in R and Shiny app in .Renviron file as a secure production environment

Why is keeping your password, port, host, and all secrets of a database (e.g. PostgreSQL) in the .Renviron file safe for Shiny apps and R scripts? I have a question about the .Renviron file and its security password. Although the .Renviron file is a…
1
vote
0 answers

Incomplete error message from RPostgreSQL

The error messages I get from RPostgreSQL contain nonsense characters where there should be some informative text. Here are two examples: Example 1: Querying a non-existent table > library("RPostgreSQL") Loading required package: DBI > drv <-…
Molly
  • 13,240
  • 4
  • 44
  • 45