1 <!doctype html public
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
8 <title>Postfix CDB Howto
</title>
10 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
16 <h1><img src=
"postfix-logo.jpg" width=
"203" height=
"98" ALT=
"">Postfix CDB Howto
</h1>
22 <p> CDB (Constant DataBase) is an indexed file format designed by
23 Daniel Bernstein. CDB is optimized exclusively for read access
24 and guarantees that each record will be read in at most two disk
25 accesses. This is achieved by forgoing support for incremental
26 updates: no single-record inserts or deletes are supported. CDB
27 databases can be modified only by rebuilding them completely from
28 scratch, hence the
"constant" qualifier in the name.
</p>
30 <p> Postfix CDB databases are specified as
"cdb:<i>name</i>", where
31 <i>name
</i> specifies the CDB file name without the
".cdb" suffix
32 (another suffix,
".tmp", is used temporarily while a CDB file is
33 under construction). CDB databases are maintained with the postmap(
1)
34 or postalias(
1) command. The DATABASE_README document has general
35 information about Postfix databases.
</p>
37 <p> CDB support is available with Postfix
2.2 and later releases.
38 This document describes how to build Postfix with CDB support.
</p>
40 <h2>Building Postfix with CDB support
</h2>
42 <p> These instructions assume that you build Postfix from source
43 code as described in the INSTALL document. Some modification may
44 be required if you build Postfix from a vendor-specific source
47 <p> Postfix is compatible with two CDB implementations:
</p>
51 <li> <p> The original cdb library from Daniel Bernstein, available
52 from http://cr.yp.to/cdb.html, and
</p>
54 <li> <p> tinycdb (version
0.5 and later) from Michael Tokarev,
55 available from http://www.corpit.ru/mjt/tinycdb.html.
</p>
59 <p> Tinycdb is preferred, since it is a bit faster, has additional
60 useful functionality and is much simpler to use.
</p>
62 <p>To build Postfix after you have installed tinycdb, use something
68 % CDB=../../../tinycdb-
0.5
69 % make -f Makefile.init makefiles
"CCARGS=-DHAS_CDB -I$CDB" \
70 "AUXLIBS=$CDB/libcdb.a"
75 <p> Alternatively, for the D.J.B. version of CDB:
<p>
80 % CDB=../../../cdb-
0.75
81 % make -f Makefile.init makefiles
"CCARGS=-DHAS_CDB -I$CDB" \
82 "AUXLIBS=$CDB/cdb.a $CDB/alloc.a $CDB/buffer.a $CDB/unix.a $CDB/byte.a"
87 <p> After Postfix has been built with cdb support, you can use
88 "cdb" tables wherever you can use read-only
"hash",
"btree" or
89 "dbm" tables. However, the
"<b>postmap -i</b>" (incremental record
90 insertion) and
"<b>postmap -d</b>" (incremental record deletion)
91 command-line options are not available. For the same reason the
92 "cdb" map type cannot be used to store the persistent address
93 verification cache for the verify(
8) service, or to store
94 TLS session information for the tlsmgr(
8) service.
</p>