Re: [Dovecot] expire plugin: columns not uniq

2009-08-31 Thread Nikita Koshikov
On Mon, 24 Aug 2009 13:33:15 -0400 Timo Sirainen t...@iki.fi wrote: On Mon, 2009-08-24 at 13:27 -0400, Timo Sirainen wrote: CREATE TRIGGER mergeexpire BEFORE INSERT ON expires FOR EACH ROW BEGIN UPDATE expires SET expire_stamp=NEW.expire_stamp WHERE username =

Re: [Dovecot] expire plugin: columns not uniq

2009-08-24 Thread Timo Sirainen
On Fri, 2009-08-21 at 17:02 +0300, Nikita Koshikov wrote: Search the Wiki about Postgres and the requirement of a TRIGGER. I guess that sqlite requires something like this. Maybe someone family with sqlite will say how to make this trigger better and constrain check field existence before

Re: [Dovecot] expire plugin: columns not uniq

2009-08-24 Thread Timo Sirainen
On Mon, 2009-08-24 at 13:27 -0400, Timo Sirainen wrote: CREATE TRIGGER mergeexpire BEFORE INSERT ON expires FOR EACH ROW BEGIN UPDATE expires SET expire_stamp=NEW.expire_stamp WHERE username = NEW.username AND mailbox = NEW.mailbox; SELECT raise(ignore)

Re: [Dovecot] expire plugin: columns not uniq

2009-08-21 Thread Steffen Kaiser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 19 Aug 2009, Nikita Koshikov wrote: How can I solve this ? and why expire plugin is trying to use INSERT, instead of UPDATE ? Search the Wiki about Postgres and the requirement of a TRIGGER. I guess that sqlite requires something like

Re: [Dovecot] expire plugin: columns not uniq

2009-08-21 Thread Nikita Koshikov
On Fri, 21 Aug 2009 10:48:42 +0200 (CEST) Steffen Kaiser skdove...@smail.inf.fh-brs.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 19 Aug 2009, Nikita Koshikov wrote: How can I solve this ? and why expire plugin is trying to use INSERT, instead of UPDATE ? Search

Re: [Dovecot] expire plugin: columns not uniq

2009-08-21 Thread Nikita Koshikov
Search the Wiki about Postgres and the requirement of a TRIGGER. I guess that sqlite requires something like this. Maybe someone family with sqlite will say how to make this trigger better and constrain check field existence before doing UPDATE CREATE TRIGGER mergeexpire BEFORE INSERT ON

Re: [Dovecot] expire plugin: columns not uniq

2009-08-21 Thread Steffen Kaiser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, 21 Aug 2009, Nikita Koshikov wrote: You mean in dovecot expire plugin or where ? No, in general. If one wants some data in a DB, but update if already present. If you re-programm the TRIGGER in the client, you need to lock the whole

Re: [Dovecot] expire plugin: columns not uniq

2009-08-21 Thread Nikita Koshikov
No, in general. If one wants some data in a DB, but update if already present. If you re-programm the TRIGGER in the client, you need to lock the whole table, if you want to overcome all race conditions and also don't want any errors logged (at least with postgres). Thanks for explanation.

[Dovecot] expire plugin: columns not uniq

2009-08-19 Thread Nikita Koshikov
Hello list, My dovecot setup have expire plugin enabled. It is working fine: new records added to database(sqlite), expire-tool successfully expunges old mail, but when expire-tool try to update database record for processed user, I get error in logs: r...@mail dovecot 0:0 #