[BioC] annotate incompatible with RdbiPgSQL !?!

Hervé Pagès hpages at fhcrc.org
Thu Apr 30 00:50:16 CEST 2009


Hi Philip,

Philip Lijnzaad wrote:
> [ sorry, my reply was intended to go to BioC (I realize BioC-devel would 
> prolly have been more approppriate) ]
>   
> On Monday 27 April 2009 19:14:40 you wrote:
>> Hi Philip,
>>   Please upgrade to R 2.9.x and relevant packages.  
> 
> I am sorry that I forgot to mention that I had actually tested it there as 
> well, and the issue is identical (see below).  I had to downgrade to a 
> previous release because RdbiPgSQL is broken in 2.9.x 
> (see thread 'RdbiPgSQL problem: SET_VECTOR_ELT() can only be applied to 
> a 'list', not a 'character'). 
> 
> (The 'unable to find an inherited method for function "dbConnect", for 
> signature "PgSQL"' bug occurs only in combination with library(DBI), and is 
> triggered by the PgSQL() call.

It's unlikely to be the case since PgSQL() is defined as:

PgSQL <- function() {

   out <- list(description = "PostgreSQL object")

   class(out) <- c("PgSQL", "Rdbi")

   return(out)

}

>> conn=dbConnect(PgSQL(), host=db.host, dbname=db.name, user=db.user, 
> password=db.password)
> Error in function (classes, fdef, mtable)  : 
>   unable to find an inherited method for function "dbConnect", for 
> signature "PgSQL"

There are 2 dbConnect() generic functions: one is defined in DBI
and the other in Rdbi. Roughly speaking DBI and Rdbi are 2
incompatible infrastructure packages on top of which R interfaces
to specific RDBMS can be written. The current DBI and Rdbi families
include:

  - RSQLite, RMySQL, RPostgreSQL, ROracle for the DBI family.

  - RdbiPgSQL (and maybe others that I'm not aware of) for the
    Rdbi family.

Rdbi existed before DBI but is obsolete now. We have kept
Rdbi + RdbiPgSQL in Bioconductor so far only because the DBI family
was lacking an interface for PostgreSQL. But now that RPostgreSQL
is here (released in last October, available on CRAN), there is no
reason for anybody to keep using Rdbi + RdbiPgSQL. So our plan is
to deprecate them soon (after we've done enough testing of the new
RPostgreSQL package).

In the mean time, the right way to deal with this name clashing
is to use fully-qualified names:

   conn <- Rdbi::dbConnect(PgSQL(), ...)

Cheers,
H.


-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioconductor mailing list