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 doing UPDATE > > 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) > WHERE (SELECT 1 FROM expires WHERE username = NEW.username AND > mailbox = NEW.mailbox) IS NOT NULL; > END; > > This seem some kind crudely to me, but it's working.
That looks correct to me. I'll add it to the wiki page. A similar trigger could be used for dict quota too. So now that SQLite is working, I'll just start deprecating Berkeley DB support even more strongly. Thanks. :)
signature.asc
Description: This is a digitally signed message part