Displaying 1 result from an estimated 1 matches for "merge_expires".
2009 Aug 09
1
Wiki entry for expire plugin, PostgreSQL trigger needs update
The wiki entry at http://wiki.dovecot.org/Plugins/Expire needs an
update for Dovecot 1.2 and PostgreSQL:
-- v1.2+:
CREATE OR REPLACE FUNCTION merge_expires() RETURNS TRIGGER AS $$
BEGIN
IF exists(SELECT 1 FROM expires WHERE username = NEW.username AND mailbox = NEW.mailbox) THEN
UPDATE expires SET expire_stamp = NEW.expire_stamp
WHERE username = NEW.username AND mailbox = NEW.mailbox;
RETURN NULL;
ELSE
RETURN NEW;
END IF;
END;...