[R-sig-DB] DBI driver for PostgreSQL?

David James dj @end|ng |rom re@e@rch@be||-|@b@@com
Wed Nov 20 17:24:14 CET 2002


Dirk Eddelbuettel wrote:
> 
> 
> > That's correct.  Rdbi.PGSQL requires Rdbi, not DBI.
> 
> So allow me to repeat Doug's question:   
> 
>    Is there an R DBI-compliant driver for PostgreSQL?
>    
> I am getting confused between DBI and in DBI-on-CRAN and DBI as 
> in what's-really-called-RDBI-and-lives-on-sourceforge ?

Yes, IMHO there's a DBI-compliant driver for PostgreSQL, but read on.  
Some points that I hope will clarify the issue:

(1) There is one generic API (as defined by the R-SIG-DB) for database 
    interfaces independent of packages and DBMS.

(2) Both packages Rdbi and DBI are implementations of the same API
    (except for minor changes).  These packages provide *only* the
    generic functions and class definitions (they do not work with 
    any DBMS).  The package Rdbi uses version 3 classes and methods, 
    the package DBI uses version 4 style classes and methods.

    One obvious analogy is ODBC, unixODBC, iOdbc and Microsoft's ODBC.
    Generically, ODBC is a standard API conforming to bodies such
    as the ISO, ANSI, X, etc., and unixODBC/iODBC/MS ODBC are different
    implementations of that one API.

    Just like unixODBC and iODBC are different implementations of
    one ODBC API, the packages Rdbi and DBI are implementations 
    of the one API defined by the R-SIG-DB (and still evolving).

    (Perhaps we should call the API something other than DBI, say
    DB-API?)

(3) Users do not decide which of the Rdbi or DBI package to use (nor
    they should care).  Developers of R/DBMS drivers do.

    If you need to connect to PostgreSQL, use the packages that the
    developer requires, in this case Rdbi and RPgSQL.  If you need
    to connect to MySQL, use RMySQL with DBI.  And so on.

> 
> Was RDBI an early prototype or fork of DBI?  What is needed
> to merge them?  I'd love to help, and though I have code a 
> fair amount I have very little C coding experience when it
> comes to DBMS.

No, just a different implementation -- see (2) above.

It would be great if you could help.  I think that Tim Keitt, the 
RPgSQL developer, would like to pass on the maintance of RPgSQL,
and since he's done a very nice job with RPgSQL it may not be
too difficult.  You two may want to chat some more.


> 
> ...
> 

--
David




More information about the R-sig-DB mailing list