In PostgreSQL 18, what does SELECT count(*), sum(v) FROM m WHERE false; return, given that the WHERE clause removes every row?
Explanation
An aggregate query without GROUP BY always yields exactly one row, and count is the exception that returns 0 over an empty input while the other aggregates return null. Expecting 0 and 0 is the classic cause of a null slipping into a total; coalesce(sum(v), 0) is the usual guard.