Reset inherited flags on chunks attached to a hypertable - #10352
Merged
Conversation
|
@dbeck, @antekresic: please review this pull request.
|
svenklemm
force-pushed
the
sven/attislocal
branch
from
July 28, 2026 20:26
a876cf7 to
89fc5b4
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
svenklemm
force-pushed
the
sven/attislocal
branch
from
July 29, 2026 04:45
89fc5b4 to
5e28da6
Compare
melihmutlu
reviewed
Jul 29, 2026
Comment on lines
1228
to
+1230
| AlterTable(&alterstmt, lockmode, &atcontext); | ||
|
|
||
| chunk_reset_inherited_flags(atcontext.relid); |
Member
There was a problem hiding this comment.
chunk_add_inheritance is also called by add_foreign_table_as_chunk. would that caller be affected by this change?
svenklemm
force-pushed
the
sven/attislocal
branch
2 times, most recently
from
July 30, 2026 10:47
ca022d1 to
538dcc3
Compare
antekresic
approved these changes
Jul 30, 2026
antekresic
left a comment
Member
There was a problem hiding this comment.
We should also add a test with attaching foreign table for completeness.
Otherwise, lgtm.
svenklemm
force-pushed
the
sven/attislocal
branch
2 times, most recently
from
July 31, 2026 08:52
61e2524 to
1f04d33
Compare
Member
Author
done |
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
force-pushed
the
sven/attislocal
branch
from
July 31, 2026 08:56
1f04d33 to
413a3af
Compare
melihmutlu
approved these changes
Jul 31, 2026
Member
|
Automated backport to 2.29.x not done: cherry-pick failed. Git status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When attaching a chunk to a hypertable we would mark the relation as
inherited but leave the columns marked as local so a later DROP COLUMN
on the hypertable would not propagate to the chunk.
Clear the local flag on the inherited columns when a chunk is attached
so column 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.