‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, May 19, 2019 10:45 PM, John Fawcett via dovecot 
<dovecot@dovecot.org> wrote:

> so basically if this works just as well:
>
> INSERT INTO last_logins (last_login,username,domain) VALUES 
> (1558273000,'u...@domain.tld','domain.tld') ON CONFLICT DO UPDATE SET 
> last_login=1558273000,domain='domain.tld';
>
> 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.

Unfortunately this query does not work, it looks like it really requires the 
column name as you can see below from the error message:

ERROR:  ON CONFLICT DO UPDATE requires inference specification or constraint 
name
LINE 1: ...ain) VALUES (1558273000,'u...@domain.tld','domain.tld') ON CONFLIC...
                                                             ^
HINT:  For example, ON CONFLICT (column_name).

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.

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.

Reply via email to