Fix lastseenmsgid updates in PostgreSQL 277/head
authorMichael Marley <michael@michaelmarley.com>
Thu, 9 Mar 2017 15:46:14 +0000 (10:46 -0500)
committerMichael Marley <michael@michaelmarley.com>
Thu, 9 Mar 2017 15:51:16 +0000 (10:51 -0500)
commit5e3bcda8c341dbe6846d4723afe7096acca8f304
tree9f60363bd3e36f25b891c69dba01f3a710dfac1b
parent8af0ba8424957091f3b661e9f52b787681f0a51d
Fix lastseenmsgid updates in PostgreSQL

GH-273 introduced a workaround for the issue where sometimes the
lastseenmsgid for a buffer was set to a msgid not in that buffer.
However, the workaround was incorrect as the "min()" function in
PostgreSQL is an aggregate function for use on a column, not a
function to return the least of a list of values passed in.  The
correct function for use here is "least()".
src/core/SQL/PostgreSQL/20/update_buffer_lastseen.sql