Skip to content

Reset inherited flags on chunks attached to a hypertable - #10393

Merged
svenklemm merged 1 commit into
2.29.xfrom
sven/backport_attislocal
Aug 3, 2026
Merged

Reset inherited flags on chunks attached to a hypertable#10393
svenklemm merged 1 commit into
2.29.xfrom
sven/backport_attislocal

Conversation

@svenklemm

Copy link
Copy Markdown
Member

Attaching an existing table as a chunk uses ALTER TABLE ... INHERIT,
which raises the inheritance count of the child columns and constraints
but leaves them marked as locally defined. A chunk is meant to be a pure
inheritance child, so a later DROP COLUMN or DROP CONSTRAINT on the
hypertable did not reach such a chunk and left an orphaned column or
constraint behind instead.

Clear the local flag on the inherited columns and constraints when a
chunk is attached so schema changes on the hypertable propagate to it.
Also add a migration that fixes chunks already left in this state by an
earlier detach and attach round-trip.

Attaching an existing table as a chunk uses ALTER TABLE ... INHERIT,
which raises the inheritance count of the child columns and constraints
but leaves them marked as locally defined. A chunk is meant to be a pure
inheritance child, so a later DROP COLUMN or DROP CONSTRAINT on the
hypertable did not reach such a chunk and left an orphaned column or
constraint behind instead.

Clear the local flag on the inherited columns and constraints when a
chunk is attached so schema changes on the hypertable propagate to it.
Also add a migration that fixes chunks already left in this state by an
earlier detach and attach round-trip.
@svenklemm
svenklemm enabled auto-merge (rebase) August 3, 2026 18:02
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/chunk.c 86.66% 1 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@svenklemm
svenklemm disabled auto-merge August 3, 2026 18:50
@svenklemm
svenklemm merged commit 85ac962 into 2.29.x Aug 3, 2026
62 of 63 checks passed
@svenklemm
svenklemm deleted the sven/backport_attislocal branch August 3, 2026 18:51
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.

1 participant