Use more strict SQL in payments query

SQLite is not as strict here so I didn't catch this locally.
Postgres requires this strictness per the SQL standard.