Dear Iain,

On Thu, Oct 2, 2008 at 4:57 AM, Iain Murchland <iain.murchl...@gmail.com> wrote:
>
> Just wondering if you can clarify the state of Postgres support in
> RDKit? The Linux build instructions used to refer to needing pyPgSql
> except in Python 2.5. That was a bit of a mystery to me, but perhaps was
> trying to suggest that there is no Python2.5-compatible release of
> pyPgSql since the last release was June 2006. Now with the Q3 release
> all mention of Postgres has disappeared ...
>

Short answer: this is primarily a documentation thing. As far as using
the database code in the RDKit, everything ought to be ok with
pyPgSQL. Here's a little demo:

% export RD_USESQLLITE=""
% ipython
[1]>>> from Dbase.DbConnection import DbConnect
[2]>>> conn = DbConnect('::RDTest')
[3]>>> curs = conn.GetCursor()
[4]>>> curs.execute('create table testTable (foo int,bar int)')
[5]>>> conn.Commit()
[> Is it that pyPgSql fell over? Would you be interested in bringing
> Postgres back into the picture if someone altered the Pg sections of
> code to work with a different python module?
6]>>> conn.InsertData('testTable',(1,10))
[7]>>> conn.InsertData('testTable',(2,23))
[8]>>> conn.Commit()
[10]>>> list(conn.GetData('testTable'))
Out[10] [[1, 10], [2, 23]]

The documentation changed to simplify the build instructions for the
minimal case.

-----------------------

Longer answer: I have gotten somewhat away from using postgres.
Sqlite, with all its limitations, is much more straightforward for me
to use in my day job (big database stuff is done with oracle), so it's
what I use more heavily. This means that some of the more recently
added "convenience" database tools, like the stuff in
$RDBASE/Projects/DbCLI, don't work with postgres. This is something
that should be changed; those are useful tools. I'm not sure when I
will get around to making those changes, but I'm happy to take patches
if someone else does so.

> Is it that pyPgSql fell over? Would you be interested in bringing
> Postgres back into the picture if someone altered the Pg sections of
> code to work with a different python module?

If pyPgSql is no longer the thing one should use for postgres access
and you can make the additions/changes to the RDKit code (should be
localized to $RDBASE/Python/RDConfig.py and
$RDBASE/Python/DbModule.py), I will gladly integrate whatever patches
you have.

-greg

Reply via email to