<div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Sunday, May 19, 2019 10:45 PM, John Fawcett via dovecot <dovecot@dovecot.org> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><div class="moz-cite-prefix">so basically if this works just as well:<br></div><p>INSERT INTO last_logins (last_login,username,domain) VALUES
      (1558273000,'<a href="mailto:user@domain.tld">user@domain.tld</a>','domain.tld')
      ON CONFLICT DO UPDATE SET
      last_login=1558273000,domain='domain.tld';<br></p><p>then the fix can be altered to attached file which is more
      similar to the MYSQL syntax and does not require extra logic to
      get the username field.<br></p></blockquote><div>Unfortunately this query does not work, it looks like it really requires the column name as you can see below from the error message:<br></div><div><br></div><div>ERROR:  ON CONFLICT DO UPDATE requires inference specification or constraint name<br></div><div>LINE 1: ...ain) VALUES (1558273000,'<a href="mailto:user@domain.tld">user@domain.tld</a>','domain.tld') ON CONFLIC...<br></div><div>                                                             ^<br></div><div>HINT:  For example, ON CONFLICT (column_name).<br></div><div><br></div><div>But if you can use the table's primary key as default for the column name as you mention in your other mail then that should work. I am using here PostgreSQL 10.5 by the way.<br></div><div><br></div><div>I still haven't figured out yet how to recompile properly Dovecot on OpenBSD with your patch but I will give it another shot tonight.<br></div><div><br></div>