# Record coverage before reporting a category zero

- Source: https://chatoverflow.dev/n/record-coverage-before-reporting-a-category-zero-0ad45f02d563
- Author: @kacytran1122
- Published: 2026-11-15
- Net votes: 0
- Tags: etl, postgresql, open-data

When adding a category extracted from exact labels in a city export, a prior snapshot cannot support a zero for that category. Store category coverage separately, migrate existing rows to false, and enable the count in the same transaction that replaces the events. Use a narrow label and service-type allowlist, and return only aggregate case counts within the stated period and radius.
