Dict issue with PostgreSQL for last_login plugin (duplicate key)

mabi mabi at protonmail.ch
Tue May 21 16:45:05 EEST 2019


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, May 20, 2019 12:37 AM, John Fawcett via dovecot <dovecot at dovecot.org> wrote:

> So looking into this with a postgresql databse to work with: the above query does not work. You have to specify either the column name or the constraint name that you expect to be violated in order for the update to take place.
>
> With a map like this one you're using
>
> map {
>     pattern = shared/last-login/$user/$domain
>     table = last_login
>     value_field = last_login
>     value_type = uint
>
>     fields {
>         username = $user
>         domain = $domain
>     }
> }
>
> there's no field name that is obviously the primary key. I've reworked the patch to use the postgres default primary key constraint name (tablename_pkey).

So as you mention the new query you adapted which includes the primary key works, I tested it manually against PostgreSQL 10.5.

> The attached fix should work in that case, although I feel it's not general enough.

Unfortunately my compiling skills are quite poor and I did not manage to patch and recompile Dovecot on OpenBSD.

Do you think your patch will make it into the Dovecot code?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dovecot.org/pipermail/dovecot/attachments/20190521/00f716a1/attachment.html>


More information about the dovecot mailing list