From 7f5994a40de12eb10ec6bbcb37d17e8e1893fc80 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 18 Aug 2025 14:36:33 -0400 Subject: [PATCH] handle nulls --- procs/single_price_call.pg.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/procs/single_price_call.pg.sql b/procs/single_price_call.pg.sql index 3ec1fef..0161be2 100644 --- a/procs/single_price_call.pg.sql +++ b/procs/single_price_call.pg.sql @@ -289,7 +289,7 @@ BEGIN AND tp.ds = _last_dataseg AND tp.chan = _chan AND tp.tier = _tier - AND FLOOR(_last_qty / _pltq)::int <@ tp.vol; + AND FLOOR(_last_qty / NULLIF(_pltq, 0))::int <@ tp.vol; ------------------------------------------------------------------ -- Step 4: Cost data for normalization