NOTE: This commit should be squashed into the previous commit from
justJanne. It's committed separately just to make it easier to see
what I changed.
Fixup the SQLite and PostgreSQL queries to treat "<= 0" as any
type/flag instead of just "= 0". This matches the function
definitions and fixes specifying "-1" instead of "0". Without this
change, specifying "-1" will result in missing messages!