Skip to content

How to Query Recent CDC Tables in PostgreSQL

May 2026

In PostgreSQL, recent CDC queries should read the applied target table, not the staging table that only exists to make the merge path work.

Short Answer

To query recent CDC tables in PostgreSQL, read the reconciled target table and filter on a real time column that represents business recency. The staging table is there to support the apply pattern efficiently, not to serve as the primary analytics surface.

If you need recent deletes, use the companion tombstone table. The _skippr_order_token column should stay in its intended role as an ordering guard for replay safety, not as the main field for human-readable recent windows.

Why Teams Struggle with This

This matters because PostgreSQL makes it easy for teams to peek into every intermediate object. That can blur the line between operational apply structures and the table that is supposed to represent current warehouse truth.

  • The target table is the place where final-state reconciliation has already happened.
  • The staging table is useful for loading, but not the default read path for analysts.
  • A recent-window filter still needs a timestamp column with domain meaning.
  • Delete visibility belongs in the tombstone table, not in guessed absence checks.

How Skippr Handles It

Skippr keeps PostgreSQL query patterns clean by separating the operational staging path from the read-facing destination table. CDC-managed targets get _skippr_order_token and a companion tombstone table, but readers can usually ignore both unless they are debugging replay behavior or delete history.

A concrete example: to see recently changed support tickets, query the tickets target table where updated_at >= now() - interval 1 day. If you also need tickets deleted in that window, inspect the tombstone companion keyed by the same business columns.

  • Query the reconciled target table for current-state analytics.
  • Use staging tables for load mechanics, not for normal recent-data reporting.
  • Use tombstones for recent delete inspection.
  • Use business time columns for recency filters rather than order tokens.

What the First Useful Version Looks Like

PostgreSQL recent CDC querying gets easier when you stop asking intermediate tables to answer final-state questions.

Read the applied target, filter on real time, and only drop lower when you are debugging the pipeline itself.