postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Re: verify db with mysql

Re: verify db with mysql

From: Stefan Jakobs <stefan_at_nospam>
Date: Sat Oct 02 2010 - 00:19:20 GMT
To: Postfix users <postfix-users@postfix.org>

On Friday 01 October 2010 18:58:26 Wietse Venema wrote:
> Stefan:
> > Hi list,
> >
> > I'm in the process of adding write support to postfix's mysql client (you
> > will find a patch against postfix-2.7.1 in the appendix). But I have two
> > problems: 1) the dict_cache_clean_event writes
> > _LAST_CACHE_CLEANUP_COMPLETED_ to the database. Is this the intended
> > behaviour?
>
> This record is needed by the cache cleanup pseudo-thread. This code
> assumes that the verify(8) daemon is responsible for cleaning up
> the verify(8) cache.

Ah, fine. So that's OK.

> > 2) If I'm guessing right then the dict_cache_clean_event will iterate
> > with help of dict->sequence through the database and will look for keys
> > to expire. But I don't know how to implement this iteration/traverse
> > process with mysql. My first thought was to use "SELECT * FROM verify"
> > and mysql_use_result() but I'm wondering if there is a better solution.
> > Has anyone an idea of how to do this?
>
> Does the database support a first/next operation?

The operation which comes close to that, is to select the whole table and then
fetch the keys row by row. Yes, I think that is a first/next operation (with a
bad performance).

What would be the answer if there wasn't a first/next operation?

> Wietse

Thank you in advance.
Stefan

<snip>