[Python-Dev] Including BSDDB3

Martin v. Loewis martin@v.loewis.de
Tue, 8 Jan 2002 08:33:53 +0100


> - It'd be great if we actually provided bsddb1, bsddb2, bsddb3 (and
>   bsddb4?) modules which compile against the older libraries so
>   databases written with any version could be accessed in Python.
>   Maybe that's not exactly the right way to do it, but I don't think
>   Python should be limited to just one version of Berkeley db.  I've
>   no idea what the default ought to be -- there's no clear winner.

I'm not sure how that would work, though. Are you thinking of
different code bases for the modules, or just compiling the same
module multiple times? If the latter, how do you deal with features
that are available only in later versions? E.g. I doubt that the
current _db.c compiles with bsddb2 (not sure it even compiles with
3.0; it may be that 3.1 is required as a minimum).

This *could* be solved with lots of #ifdefs in _db.c, but that sounds
difficult to get right (who has so many versions installed to actually
test that?).

Also, I think it is rare that multiple versions are installed on a
single system: I doubt BSDDB even supports simultaneous installation
of multiple header file sets, on Unix. So even while you can have
multiple versions of the shared library installed, compiling it for
use with these libraries may be tricky.

About the only case where I know about different systems is on Linux,
where glibc incorporates a version of BSDDB2, so you might find
database file of that version that the more recent BSDDB3 cannot open,
anymore. For any other scenario, users are to blame for forgetting to
update their database files when updating the libraries.

Regards,
Martin