Home | History | Annotate | Line # | Download | only in html
CDB_README.html revision 1.1.1.1.4.2
      1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
      2         "http://www.w3.org/TR/html4/loose.dtd">
      3 
      4 <html>
      5 
      6 <head>
      7 
      8 <title>Postfix CDB Howto</title>
      9 
     10 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
     11 
     12 </head>
     13 
     14 <body>
     15 
     16 <h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix CDB Howto</h1>
     17 
     18 <hr>
     19 
     20 <h2>Introduction</h2>
     21 
     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>
     29 
     30 <p> Postfix CDB databases are specified as "<a href="CDB_README.html">cdb</a>:<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 <a href="postmap.1.html">postmap(1)</a>
     34 or <a href="postalias.1.html">postalias(1)</a> command. The <a href="DATABASE_README.html">DATABASE_README</a> document has general
     35 information about Postfix databases.  </p>
     36 
     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>
     39 
     40 <h2>Building Postfix with CDB support</h2>
     41 
     42 <p> These instructions assume that you build Postfix from source
     43 code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may
     44 be required if you build Postfix from a vendor-specific source
     45 package.  </p>
     46 
     47 <p> Postfix is compatible with two CDB implementations: </p>
     48 
     49 <ul>
     50 
     51 <li> <p> The original cdb library from Daniel Bernstein, available
     52 from <a href="http://cr.yp.to/cdb.html">http://cr.yp.to/cdb.html</a>, and </p>
     53 
     54 <li> <p> tinycdb (version 0.5 and later) from Michael Tokarev,
     55 available from <a href="http://www.corpit.ru/mjt/tinycdb.html">http://www.corpit.ru/mjt/tinycdb.html</a>. </p>
     56 
     57 </ul>
     58 
     59 <p>  Tinycdb is preferred, since it is a bit faster, has additional
     60 useful functionality and is much simpler to use. </p>
     61 
     62 <p>To build Postfix after you have installed tinycdb, use something
     63 like: </p>
     64 
     65 <blockquote>
     66 <pre>
     67 % make tidy
     68 % CDB=../../../tinycdb-0.5
     69 % make -f Makefile.init makefiles "CCARGS=-DHAS_CDB -I$CDB" \
     70     "AUXLIBS=$CDB/libcdb.a"
     71 % make
     72 </pre>
     73 </blockquote>
     74 
     75 <p> Alternatively, for the D.J.B. version of CDB:<p>
     76 
     77 <blockquote>
     78 <pre>
     79 % make tidy
     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"
     83 % make
     84 </pre>
     85 </blockquote>
     86 
     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 <a href="verify.8.html">verify(8)</a> service, or to store
     94 TLS session information for the <a href="tlsmgr.8.html">tlsmgr(8)</a> service. </p>
     95