Skip to content
Prev 69 / 1559 Next

DBI driver for PostgreSQL?

Dirk Eddelbuettel wrote:
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.
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
Message-ID: <20021120112414.B9793@jessie.research.bell-labs.com>
In-Reply-To: <E18EVxn-00056R-00@sonny.eddelbuettel.com>; from edd@debian.org on Wed, Nov 20, 2002 at 08:36:23AM -0600