fetching a NULL value (directly or from a table column) while CASTing to NUMERIC causes the type coercion to fail under fetchone(). It does not fail under fetchall() or fetchmany() but I suspect this ...