You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chunks live in _timescaledb_internal, so FOR TABLES IN SCHEMA
publications miss them and replication silently skips chunk data.
Backfill chunk membership by reading the schema set straight from the
CREATE/ALTER PUBLICATION parse tree (no before/after snapshots):
- CREATE PUBLICATION is reconciled in the ddl_command_end event trigger
(the publication Oid exists by then); add CREATE PUBLICATION to the
timescaledb_ddl_command_end WHEN TAG list.
- ALTER PUBLICATION ADD/DROP/SET TABLES IN SCHEMA is reconciled in
process_ddl_command_start after prev_ProcessUtility. SET rebuilds the
full new schema set (PG drops every tracked chunk row on SET); only
DROP removes them. Options-only ALTER is a no-op.
ALTER TABLE ... SET SCHEMA on a hypertable now reconciles its chunks:
remove from the old schema publications, add to the new ones. Runs
before ts_hypertable_set_schema flips the catalog schema.
Skip adding a redundant explicit pg_publication_rel row when a chunk
already lives in a schema this publication covers natively (chunks
placed via associated_schema_name); the explicit row would survive a
later DROP TABLES IN SCHEMA and orphan. OSM (foreign-table) chunks are
skipped throughout; publication_add_relation would fail on them.
Tests 6b-6i cover CREATE/ADD/SET/DROP/CURRENT_SCHEMA, schema moves,
the redundancy guard (counts of pg_publication_rel rows), options-only
ALTER, and GUC-off on the ALTER/schema-change paths.
Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
0 commit comments