Tomas Lanczos | 29 Nov 16:32 2012

Problems with the RPostgreSQL package compilation


  I am trying to install RPostgreSQL, but without success at the moment,
getting an errormessage - see below.
  My OS is Fedora 17, R version 2.15.2, PostgreSQL 9.2.1 with Postgis
2.0.1 spatial extension. I installed libpqxx 4.0.0 and its devel
tools also.

  Thank You for any help, advice or hint in advance.



  install.packages("RPostgreSQL", dependencies=TRUE)
  trying URL ''
  Content type 'application/x-gzip' length 474570 bytes (463 Kb)
  opened URL
  downloaded 463 Kb

  * installing *source* package ‘RPostgreSQL’ ...
  ** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
  checking for gcc... gcc
  checking for C compiler default output file name... a.out
  checking whether the C compiler works... yes
  checking whether we are cross compiling... no
  checking for suffix of executables...
(Continue reading)

Paul Gilbert | 28 Nov 18:17 2012

problems with RPostgreSQL compilation

(moved from R-help)

You should get better help with this on R-SIG-DB. It seems you need some 
additional hint to help the loader find pg.

On 12-11-28 06:00 AM, r-help-request@... wrote:
> Date: Thu, 22 Nov 2012 12:15:18 +0100
> From: Tomas Lanczos<lanczos@...>
> To:r-help@...
> Subject: Re: [R] problems with RPostgreSQL compilation
> Message-ID: <1353582918.3021.12.camel <at> freya>
> Content-Type: text/plain; charset="UTF-8"
> Thank You for Your answer.I have installed libpqxx 4.0.0 and its devel
> tools also.
> Regards
> Tomas
> On Thu, 2012-11-22 at 19:32 +0900, Pascal Oettli wrote:
>> >Hello,
>> >
>> >Do you have the shared libraries required by PostgreSQL installed on
>> >your machine (libpq)?
>> >
>> >Regards,
(Continue reading)

MacQueen, Don | 16 Nov 20:11 2012

ROracle 1.1-5 and date fields?

I updated R and packages today, and am seeing some changes in ROracle
behavior that I want to ask about. I'll describe the problems first;
details follow.

1) dbListTables now lists only my personal tables
previously it listed global tables
(don't see any way to show an example of this)

2) simple queries to tables with date fields fail.
For example,

> dbGetQuery(con,"select * from wdrstats")
Error in .oci.GetQuery(conn, statement, ...) :
  Error in try({ : ORA-01805: possible error in date/time operation

The table in this example has, among others, two date fields.
That is, "describe wdrstats;" returns (among others)
EFFDATE             DATE
By the way, I'm very happy to see that ROracle is being actively
maintained. Thank you!


This was a substantial upgrade; previously I had
  ROracle 0.5-12 with R 2.14.1
now I have
  ROracle 1.1-5 and R 2.15.2
(Continue reading)

Benjamin Tyner | 11 Nov 05:10 2012

RJDBC: dbGetQuery works but fetch does not.


When using fetch() with RJDBC, I get the error:

   Error in function (classes, fdef, mtable)  :
     unable to find an inherited method for function "fetch", for 
signature "JDBCResult", "missing"

However if I use dbGetQuery instead, it works splendidly. my driverClass 
is com.sybase.jdbc2.jdbc.SybDriver and I'm using:

   R version 2.14.1 (2011-12-22)
   Platform: x86_64-unknown-linux-gnu (64-bit)

Any ideas?

Attachment (smime.p7s): application/x-pkcs7-signature, 5105 bytes
R-sig-DB mailing list -- R Special Interest Group
ajit aher | 30 Oct 15:01 2012

Java Exception error while reading large data in R from DB using RJDBC

Dear List, 

Java Exception error while reading large data in R from DB using RJDBC. 
I am trying to read large data from DB table(Vectorwise), using RJDBC connection. 
I have tested the connection with small size data and was able to fetch DB tables using same connection(conn
as in my code).   

Please suggest where  am i going wrong or alternate option to solve such issues  while reading large DB

drv <- JDBC(paste(db_driver,  sep = ""), 
           paste(db_jar_file,  sep = ""), 

conn <<- dbConnect(drv, paste(db_server,  sep = ""), 
                                        paste(db_server_lgn,  sep = ""), 
                                        paste(db_server_pwd,  sep = "")) 
s <- sprintf("select * from  cypress_modeldev_account_info") 
 temp <- dbGetQuery(conn, s) 
Error in .jcheck() : 
  Java Exception <no description because toString() 
failed>.jcall(rp, "I", "fetch", stride)<S4 object of class 


	[[alternative HTML version deleted]]

(Continue reading)

NISHIYAMA Tomoaki | 9 Oct 11:21 2012

Insufficient PROTECT in RMySQL code


We recently identified errors in RPostgreSQL that PROTECT is not
issued where needed.  The behaviour reported at
is similar in RMySQL.

The fix is seeking every C code returning a pointer to s_object or 
its aliases (i.e., Mgr_Handle, Con_Handle, Res_Handle, Db_Handle),
and carefully ensure the structure returned is properly constructed in
PROTECTed block.

We do not have test for every places, but the following example
suggests that RMySQL probably has at least one similar error.

> library(RMySQL)
Loading required package: DBI
> con <- dbConnect('MySQL')
> rs <-dbSendQuery(con,'SELECT 1;')
> dbColumnInfo(rs)
  name  Sclass                type len precision scale nullOK
1    1 integer FIELD_TYPE_LONGLONG   1         1     0  FALSE
> dbColumnInfo(rs)
  name  Sclass                type len precision scale nullOK
1    1 integer FIELD_TYPE_LONGLONG   1         1     0  FALSE
> gctorture(TRUE)
> dbColumnInfo(rs)
  name  Sclass                type len precision scale nullOK
1    1 integer FIELD_TYPE_LONGLONG   1         1     0  FALSE
> dbColumnInfo(rs)
(Continue reading)

David | 7 Oct 23:16 2012

DB updates with ROracle - ORA-01000

I have an R script that makes an ROracle connection to a DB and pulls
data.. analyzes and then updates approx 7,000 records.

I have two functions defined in my script that look like this:

       # Create the updateTC function
        updateTC <- function(dfrm) {
                with(dfrm, {
                updateDB(paste("update SIMETRA.RTA_MARKET_STATS set
scientific=FALSE, digits=6),"' where RTA_MARKET_STATS_ID = '",MSID,"'", sep
= ""))

        # Create the updateDB function
        updateDB <- function(stmt) {
                for (update in stmt) {
                        res <- dbSendQuery(conn, update)
                        res <- dbCommit(conn)

and I call it like so (cr is a dataframe with my results):

        # Update the DB with the new geographic coefficients
        res <- dbCommit(conn)

(Continue reading)

David | 4 Oct 22:44 2012

Intermittent connectivity issues for RJDBC / Oracle

I will forward more details like versions of xyz when i can, but any
thoughts on what I can focus on to debug the problem described below?

Thank you, David
---------- Forwarded message ----------
From: "dh_ss" <david@...>
Date: Oct 4, 2012 1:29 AM
Subject: [R] Intermittent connectivity issues for JDBC / Oracle
To: <r-help@...>

I have been experiencing issues with an R script hanging when connecting to
an Oracle database.  To help debug, I found a function here in the nabble
forum and made a small test script:

  #!/usr/bin/Rscript --no-restore --no-save --no-init-file
  drv<-JDBC("oracle.jdbc.OracleDriver","/home/oracle/lib/ojdbc6.jar", "'")

  dbCheck = function(url, user='', pwd='') {
    j = .jcall("java/sql/DriverManager", "Ljava/sql/Connection;",
  "getConnection", url, user, pwd, check=FALSE)
    x = .jgetEx()
  dbCheck("jdbc:oracle:thin: <at>","myuser","mypass")

When I run the file - sometimes it works, returning NULL, and sometimes it
hangs for between 1 and 2.5 minutes before throwing an error.  The database
is new and stable, on the same network - with no connection issues from any
(Continue reading)

James David Smith | 28 Sep 16:14 2012

R and PostgreSQL - Writing data?

Dear all,

Sorry if this isn't quite the right place, but it's the first time
I've posted here. My issue is to do with writing to a PostgreSQL
database from within R. My situation is best explained by some R code
to start:

#Connect to the database
con <- dbConnect(PostgreSQL(), user="postgres", password="password",

#Get some data out of the database.
ucam_no2$original_data <- dbGetQuery(con, "select ucam_no2 FROM table")

This returns say 10000 rows of data, but there is only data in about
half of those rows. What I want to do is interpolate the missing data
so I do this:

#Generate some data
ucam_no2$interpolated_data <- na.approx(ucam_data$ucam_no2, na.rm = FALSE)

This works well and I now have 10000 rows of data with no empty cells.
I now want to write this back into my PostgresSQL database. Into the
same row that I took the data from in the first place. But I don't
know how. I can write to a new table with something like the below,
but what I'd really like to do is put the data back into the table I
got it from.

# Try to write the data back
dbWriteTable(con, "new_data", ucam_no2$interpolated_data)
(Continue reading)

Paul Gilbert | 18 Sep 17:40 2012

RMySQL and RPostgreSQL interaction

I am doing some comparison for which I load both RMySQL and RPostgreSQL 
from my own packages TSMySQL and TSPostgreSQL and I am getting the 
following warning building a vignette. I think with package namespaces / 
S4 definitions it is a bit difficult to generate a self contained 
example, at least I have not yet managed to do that, but I would 
appreciate any suggestions about what needs to be done.

Loading required package: TSPostgreSQL
Loading required package: RPostgreSQL
Warning in .simpleDuplicateClass(def, prev) :
   A specification for class "dbObjectId" in package 'RPostgreSQL' seems 
equivalent to one from package 'RMySQL' and is not turning on duplicate 
class definitions for this class

(I'm using  R version 2.15.1 on Ubuntu.)


R-sig-DB mailing list -- R Special Interest Group

Luis Ridao | 7 Sep 15:26 2012

RODBC connection linux (ubuntu)


i think this problem has come up pretty often on this and other lists
and still have not managed to solved it.

i need to connect to a an Oracle database through R.

I have installed the oracle install client and the package RODBC in R
but still get the same error:

[RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data
source name not found, and no default driver specified
2: In odbcDriverConnect("DSN=MAGNUS;UID=my_uid;PWD=my_pwd") :
  ODBC connection failed

/etc/odbc.ini looks like:

driver = Easysoft ODBC-Oracle WP
description = Easysoft Oracle ODBC WP driver
server = oserver
port = 1521
sid =
user = luisr
password =my_pwd
logging = No
logfile =
enable_user_catalog = yes
(Continue reading)