From 21a8f9622a572e584965393a9aacb70b9612e50c Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 14 Jan 2026 21:36:58 +0000 Subject: [PATCH] Avoid empty insert statement when there are no aggregations --- background/arcgis.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/background/arcgis.go b/background/arcgis.go index 6237ccef..6997a2ec 100644 --- a/background/arcgis.go +++ b/background/arcgis.go @@ -1075,6 +1075,10 @@ func updateSummaryTables(ctx context.Context, org *models.Organization) { im.SetCol("count_").To(psql.Raw("EXCLUDED.count_")), )) //log.Info().Str("sql", insertQueryToString(psql.Insert(to_insert...))).Msg("Updating...") + if len(to_insert) == 0 { + log.Info().Int("resolution", i).Msg("No updates to perform") + continue + } _, err := psql.Insert(to_insert...).Exec(ctx, db.PGInstance.BobDB) if err != nil { log.Error().Err(err).Msg("Faild to add h3 aggregation")