i'm just curious/thinking out loud if anything can be done to prevent division by zero from de-railing a huge query?  unlike most error messages, division by zero destroys a query *after* the bulk of the processing occurs - so you sit and wait and the command still fails, despite all the time and cpu revving.

i assume it's impossible to check for this event *before* a query gets executed, but would it be possible to have a database option that essentially replaces zeroes with NULLs in the circumstances that this does occur so the query still returns the rest of the table?  or would doing that be sloppy database management?

so maybe this fails

select 1 / 0 as x;

but you change some setting and it auto-coerces everything under a division operator to

select 1 / ( CASE WHEN value = 0 THEN NULL ELSE value END ) as x;

that way you lose x but maybe not other columns?


sorry if this is stupid..and thank you