Dict issue with PostgreSQL for last_login plugin (duplicate key)

John Fawcett john at voipsupport.it
Sun May 19 17:44:10 EEST 2019


On 19/05/2019 16:25, John Fawcett via dovecot wrote:
> INSERT INTO last_logins (last_login,username,domain) VALUES (1558273000,'user at 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 at domain.tld','domain.tld') ONCONFLICT(username) UPDATE SET last_login=1558273000,domain='user at 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 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dovecot.org/pipermail/dovecot/attachments/20190519/9f6aa34b/attachment.html>


More information about the dovecot mailing list