: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(data-imports): stop retrying a postgres sync whose cursor no longer matches a boolean column (#124618)
Tom Owers8316dc651c1f
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.pyindex 9c37424902b3..50af15a7b8a9 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.py@@ -1505,6 +1505,14 @@ class PostgresSource(# so stop and ask the user to reset."invalid input syntax for type integer": "PostHog tried to resume this table's incremental sync from a non-integer cursor value against an integer incremental field, which your database rejects. This usually means the incremental field's type doesn't match its data. Please reset and fully re-sync this table, or pick a different incremental field.","invalid input syntax for type bigint": "PostHog tried to resume this table's incremental sync from a non-integer cursor value against a bigint incremental field, which your database rejects. This usually means the incremental field's type doesn't match its data. Please reset and fully re-sync this table, or pick a different incremental field.",+ # Same mechanism as the integer/bigint keys above, but for a column whose declared type+ # changed to boolean at the source after it was picked as the incremental field (e.g. an+ # integer status column altered to `boolean`). `IncrementalFieldType` has no boolean+ # variant, so this never happens for a freshly configured field — only when the source+ # column's type drifted out from under an already-stored cursor. The stored watermark no+ # longer parses against the column's new type, and every retry re-runs the identical+ # failing query, so stop and ask the user to reset.+ "invalid input syntax for type boolean": "PostHog tried to resume this table's incremental sync from a cursor value that your database can no longer parse as a boolean. This usually means the incremental field's column type changed at the source after this sync started. Please reset and fully re-sync this table, or pick a different incremental field.",# Raised (ObjectNotInPrerequisiteState, SQLSTATE 55000) when a selected materialized view# was created `WITH NO DATA` and never refreshed — every SELECT against it fails until the# customer runs `REFRESH MATERIALIZED VIEW`. Deterministic and outside our control, sodiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.py b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.pyindex 4cc62b43e6dd..71bc474966dd 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.py@@ -1499,6 +1499,8 @@ class TestPostgresSourceNonRetryableErrors:'InvalidTextRepresentation: invalid input syntax for type integer: "1.5"','invalid input syntax for type bigint: "2026-04-26T20:58:57.557000"','InvalidTextRepresentation: invalid input syntax for type bigint: "2026-04-26T20:58:57.557000"',+ 'invalid input syntax for type boolean: "2"',+ 'InvalidTextRepresentation: invalid input syntax for type boolean: "2"',],)def test_non_integer_incremental_cursor_errors_are_non_retryable(self, source, error_msg):