Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(managed-warehouse): use ~ so stale-table sweep runs on duckgres (#87317)

posthog[bot]36109ae15c6e
diff --git a/products/managed_warehouse/backend/temporal/ducklake_register_data_imports_workflow.py b/products/managed_warehouse/backend/temporal/ducklake_register_data_imports_workflow.py
index 790da6fde9cd..ad72340733ec 100644
--- a/products/managed_warehouse/backend/temporal/ducklake_register_data_imports_workflow.py
+++ b/products/managed_warehouse/backend/temporal/ducklake_register_data_imports_workflow.py
@@ -853,7 +853,7 @@ def _sweep_query(schema_name: str) -> psql.Composed:
" ON sn.snapshot_id = t.begin_snapshot "
"WHERE t.end_snapshot IS NULL "
" AND s.schema_name = {} "
- " AND regexp_matches(t.table_name, {}) "
+ " AND t.table_name ~ {} "
# DuckDB does not infer intervals from bare string literals; the
# explicit CAST is what makes the age guard bind at all.
" AND (sn.snapshot_id IS NULL OR CAST(sn.snapshot_time AS TIMESTAMPTZ) < now() - CAST({} AS INTERVAL)) "