Skip to content

Conversation

@SBhanushali
Copy link

This PR adds end‑to‑end support for propagating schema and index changes from Postgres sources to Postgres destinations during CDC, gated behind new dynamic configuration flags.

Added PEERDB_POSTGRES_CDC_SCHEMA_MIGRATION_ENABLED to control column-level schema migration (add/drop/alter) for Postgres CDC mirrors.
Added PEERDB_POSTGRES_CDC_SCHEMA_MIGRATION_INDEX_ENABLED to control index-level migration (create/drop) for Postgres CDC mirrors.

For column-level schema migration:
There was already the support to detect the column drop and type change but it was just getting logged.

For index-level migration:
Existing support was only present for primary key index and not the column level indexes.
On every relation record similar to column level changes, added logic to compare current schema indexes with previous schema indexes. If there is a diff then apply it to target and update previous schema to current.

@CLAassistant
Copy link

CLAassistant commented Nov 16, 2025

CLA assistant check
All committers have signed the CLA.

@iamKunalGupta iamKunalGupta requested review from ilidemi, iskakaushik and serprex and removed request for ilidemi November 25, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants