On 19/05/2019 16:25, John Fawcett via dovecot wrote:
INSERT INTO last_logins (last_login,username,domain) VALUES (1558273000,'user@domain.tld','domain.tld')
I don't have PostgresSql, would you be able to verify if this syntax would work:

INSERT INTO last_logins (last_login,username,domain) VALUES (1558273000,'user@domain.tld','domain.tld') ON CONFLICT (username) UPDATE SET last_login=1558273000,domain='user@domain.tld'

It's important to check that this updates only the single row for that user and it puts the right data in that row. If it doesn't work can you give the correct syntax?

John