Error: Current Transaction ID Has Moved Backwards
Issue
The following error appears:
Current transaction ID has moved backwards.
Environment
Connector: PostgreSQL
Resolution
To resolve this issue, perform a full re-sync of your PostgreSQL connection:
- In the Fivetran dashboard, go to your PostgreSQL connection page.
- Open the Setup tab.
- Under Sync Settings, click Resync all historical data.
- In the confirmation pop-up window, click Re-sync Connection.
Fivetran will:
- Delete all rows in the destination tables that are currently selected in your connection’s schema.
- Reload the complete contents of those tables from the source (a full historical sync).
- Resume incremental sync once the re-sync completes.
Cause
This issue typically occurs when your PostgreSQL database instance changes from a primary to a replica, switches between replicas, or is migrated to a new server. These events reset the transaction ID sequence, which can cause Fivetran’s incremental cursor to become invalid.