[Dovecot] Custom sql query for keeping quota with dict-sql

Marcin Mirosław marcin at mejor.pl
Fri Jun 3 16:17:27 EEST 2011


W dniu 03.06.2011 13:51, Timo Sirainen pisze:
Helo Timo!
> You can't define your own SQL queries for dict quota. Besides being able
> to do such query, there's the problem that when recalculating quota it's
> done by deleting a row and inserting it back. You wouldn't want to do
> that for your users table. 
Yes...:)
I don't know internals in dovecot, mayby it will be nonsensical what
i'll say. Could it be better to set NULL instead delete of row?
Or let user can define own queries e.g.:
DICT_QUOTA_DEL= ...
DICT_QUOTA_INSERT=
DICT_QUOTA_OTHER_ACTIONS=
and do byself all internals proper for database (create trigger or do
something else).

> Making this work some other way could be
> tricky with PostgreSQL. It's quite an ugly trigger already, because
> there's no easy "ON DUPLICATE KEY UPDATE .." feature in PostgreSQL as
> there is for MySQL.

Meseems only Mysql (from popular db) has such "feature":)

Regards!


More information about the dovecot mailing list