Patrick Ben Koetter:
> * Wietse Venema <[email protected]>:
> > Victor Duchovni:
> > > On Fri, Jun 18, 2010 at 05:58:02PM +0200, Patrick Ben Koetter wrote:
> > >
> > > > > Right now this is a read-only implementation (like mysql/pgsql)
> > > > > but it may be worthwhile to add update support. SQLite implements
> > > > > locking internally. That would allow us to avoid the problems with
> > > > > Postfix's external locks on Berkeley DB maps, which are broken
> > > > > after BDB version 2.
> > > >
> > > > That's great news!
> > >
> > > Indeed. One still needs tools to insert data into the database.
> > > Does Postfix need to provide a minimal interface for this, or do we
> > > assume that SQLite users will have adequate tools outside Postfix.
> >
> > A "postmap" option to create an SQLite file would make sense.
>
> Do you mean creating an SQLite database from a flat file that, for example,
> contains access rules mapping addresses to actions (r...@foo REJECT)?
Yes.
> What if there were many files that wanted to be stored in a SQLite database?
> Creating a database only for one table would be a waste of ressources, I
> guess.
With sqlite:mapname, the "mapname" configuration file specifies
the name of the database file and the name of the table in that
database. So you can have it either way: multiple tables in one
file, or one file per table.
I would recommend to use separate database files for read/write
data and read-mostly data; if you don't write to a file it is less
likely to become corrupted.
Likewise, use separate database files for data that is sensitive
or trusted, and for data that isn't.
But, there is no way to enforce this, since every SQLite map
is configured independently.
Wietse