Skip to main content
Private Preview FeatureThis feature is currently in private preview. Contact support@firebolt.io to request early access.
Creates a managed table that Firebolt maintains continuously from a change stream: one live row per merge key, with source inserts, updates, and deletes applied in order. See CDC tables for semantics, merge modes, and performance characteristics.

Syntax

Parameters

WITH options

Notes

  • CREATE CDC TABLE records metadata only; ingestion starts with ALTER CDC TABLE ... RESUME.
  • Merge-key columns are implicitly NOT NULL.
  • In read mode, merge-key columns must be BOOLEAN, INTEGER, BIGINT, DATE, TIMESTAMP, TIMESTAMPTZ, NUMERIC, or TEXT (NUMERIC only as a single-column key). Use merge_mode = 'write' for other key types.
  • For a stream over a partitioned Postgres source, every source partition-key column must be part of the merge key.
  • Column names beginning with __, and last_seq, are reserved for CDC bookkeeping.
  • merge_mode cannot be changed after creation.
  • In read mode, direct DML, TRUNCATE, column-level ALTER TABLE, SET PRIMARY INDEX, and aggregating indexes are rejected; renaming the table is allowed. write tables behave like ordinary tables.

Examples

Mirror a Postgres table

Mirror a MongoDB collection with an inferred schema

Sort the table for analytics instead of by key

ALTER CDC TABLE

Controls the ingest worker of a CDC table:
  • RESUME binds the ingest worker to the engine that runs the statement and persists the enabled state, so ingestion resumes automatically after an engine restart. The first RESUME backfills the table from a source snapshot before streaming.
  • SUSPEND stops the worker without a final consolidation. For Postgres sources, the idle replication slot retains WAL on the source while suspended.
  • CASCADE applies to read mode and triggers the consolidation that otherwise runs every cascade_interval.

DROP TABLE

DROP TABLE <table_name> drops a CDC table together with its hidden staging storage and stops its ingest worker. Dropping the table does not drop the stream; see DROP STREAM for source-side cleanup.