2
Python and dbm modules on Debian
3
--------------------------------
5
This file documents the configuration of the dbm modules for Debian. It
6
gives hints at the preferred use of the dbm modules.
9
The preferred way to access dbm databases in Python is the anydbm module.
10
dbm databases behave like mappings (dictionaries).
12
Since there exist several dbm database formats, we choose the following
13
layout for Python on Debian:
15
* creating a new database with anydbm will create a Berkeley DB 2.X Hash
16
database file. This is the standard format used by libdb starting
19
* opening an existing database with anydbm will try to guess the format
20
of the file (using whichdb) and then load it using one of the bsddb,
21
bsddb1, gdbm or dbm (only if the python-gdbm package is installed)
24
* The modules use the following database formats:
26
- bsddb: Berkeley DB 2.X Hash (as in libc6 >=2.1 or libdb2)
27
- bsddb1: Berkeley DB 1.85 Hash (as in libc6 >=2.1 or libdb2)
28
- gdbm: GNU dbm 1.x or ndbm
29
- dbm: " (nearly the same as the gdbm module for us)
30
- dumbdbm: a hand-crafted format only used in this module
32
That means that all usual formats should be readable with anydbm.
34
* If you want to create a database in a format different from DB 2.X,
35
you can still directly use the specified module.
37
* I.e. bsddb is the preferred module, and DB 2.X is the preferred format.
39
* Note that the db1hash and bsddb1 modules are Debian specific. anydbm
40
and whichdb have been modified to support DB 2.X Hash files (see
48
Although bsddb employs the new DB 2.X format and uses the new Sleepycat
49
DB 2 library as included with glibc >= 2.1, it's still using the old
50
DB 1.85 API (which is still supported by DB 2).
52
A more recent version 1.1 of the BSD DB module (available from
53
http://starship.skyport.net/robind/python/) directly uses the DB 2.X API.
54
It has a richer set of features.
57
On a glibc 2.1 system, bsddb is linked with -ldb, bsddb1 is linked with
58
-ldb1 and gdbm as well as dbm are linked with -lgdbm.
60
On a glibc 2.0 system (e.g. potato for m68k or slink), bsddb will be
61
linked with -ldb2 while bsddb1 will be linked with -ldb (therefore
62
python-base here depends on libdb2).
65
db1hash and bsddb1 nearly completely identical to dbhash and bsddb. The
66
only difference is that bsddb is linked with the real DB 2 library, while
67
bsddb1 is linked with an library which provides compatibility with legacy
72
Gregor Hoffleit <flight@debian.org>