last_login plugin with MySQL

Michael Cramer michael at bigmichi1.de
Sun Oct 19 08:10:46 UTC 2014


Zitat von Luigi Rosa <lists at luigirosa.com>:

> Gedalya wrote on 18/10/2014 17:36:
>
>> The code looks at shared/$last_login_key, so shared/last-login/username,
>> but your map says /shared/last-login/$user, note the leading slash! That's
>> probably all it is.
>
>
> BINGO!
>
> Now that we killed the mosters of this level, let's move to the next  
> level.....
>
>
> Welcome to the SQL query level!
>
> I was expecting an UPDATE...WHERE but I got this:
>
> INSERT INTO mailbox (lastlogin,username) VALUES ('1413647370','username') ON
> DUPLICATE KEY UPDATE lastlogin='1413647370'
>
> This is not very useful if I want a `lastlogin` field of the `mailbox` table
> updated on every login.
>
>
>
>
> Ciao,
> luigi
>
> - --
> /
> +--[Luigi Rosa]--
> \
>
> For every human problem, there is a neat, simple solution;
> and it is always wrong.

anybody knows how this can be achieved with postgresql, because 'ON  
DUPLICATE KEY UPDATE' syntax is mysql specific



More information about the dovecot mailing list