ankane / dbx

A fast, easy-to-use database library for R
Other
187 stars 15 forks source link

postgresql bytea and dbxSelect won't work #14

Closed ghost closed 5 years ago

ghost commented 5 years ago

summary

using dbxSelect on a postgresql database table with a bytea column, the following error appears: postgresqlUnescapeBytea is not an exported object...

affected versions

how to create the error message

me@dbxbug@[local]> create table t_dbxbug(test bytea); CREATE TABLE me@dbxbug@[local]> insert into t_dbxbug(test) values (bytea('this is crap')); INSERT 0 1 me@dbxbug@[local]> select * from t_dbxbug; test

\x746869732069732063726170 (1 Zeile)

me@dbxbug@[local]> \q me@myserver:~$ R

R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R ist freie Software und kommt OHNE JEGLICHE GARANTIE. Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten. Tippen Sie 'license()' or 'licence()' für Details dazu.

R ist ein Gemeinschaftsprojekt mit vielen Beitragenden. Tippen Sie 'contributors()' für mehr Information und 'citation()', um zu erfahren, wie R oder R packages in Publikationen zitiert werden können.

Tippen Sie 'demo()' für einige Demos, 'help()' für on-line Hilfe, oder 'help.start()' für eine HTML Browserschnittstelle zur Hilfe. Tippen Sie 'q()', um R zu verlassen.

library(dbx) con <- dbxConnect(dbname = "dbxbug", adapter = "postgres")
dbxSelect(con, "select * from t_dbxbug") Fehler: 'postgresqlUnescapeBytea' is not an exported object from 'namespace:RPostgreSQL'

ghost commented 5 years ago

found out that this problem only occurs on using RPostgreSQL 0.4 that comes with debian stretch; if I switch to RPostgreSQL 0.6, the bug is solved. Maybe you can do a requirement of the RPostgreSQL version to the DESCRIPTION file...

ankane commented 5 years ago

Hey @jottyfan, glad you figured it out, and thanks for following up. I think it only makes sense to do a version restriction for exceptional bugs.