From 1c2879c46656cba8c9d73ee078f9bd7bd7e5266f Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 2 Apr 2026 13:29:15 -0500 Subject: [PATCH] Fix ambiguous column reference in backfill DB stats query --- lib/microwaveprop_web/live/backfill_live.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/microwaveprop_web/live/backfill_live.ex b/lib/microwaveprop_web/live/backfill_live.ex index 154c111f..26624b84 100644 --- a/lib/microwaveprop_web/live/backfill_live.ex +++ b/lib/microwaveprop_web/live/backfill_live.ex @@ -160,17 +160,17 @@ defmodule MicrowavepropWeb.BackfillLive do %{rows: rows} = Repo.query!(""" SELECT - relname as table, - n_live_tup as rows, + c.relname as table, + s.n_live_tup as rows, pg_total_relation_size(c.oid) as bytes FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace JOIN pg_stat_user_tables s ON s.relid = c.oid WHERE n.nspname = 'public' AND c.relkind = 'r' - AND relname NOT LIKE 'oban_%' - AND relname NOT LIKE 'schema_%' - AND n_live_tup > 0 + AND c.relname NOT LIKE 'oban_%' + AND c.relname NOT LIKE 'schema_%' + AND s.n_live_tup > 0 ORDER BY pg_total_relation_size(c.oid) DESC LIMIT 20 """)