Repository navigation
Keep what partitions and inheritance children have of their own - #364
Merged
Merged
Conversation
…ap partition under a parent on another access method, generation expressions, NOT NULL NO INHERIT, validated copies of a parent's NOT VALID NOT NULL and their constraint names; report access methods pull cannot express.
# Conflicts: # docs/feature_support.md # internal/diff/diff.go # internal/integration/pull_fixtures_test.go
# Conflicts: # docs/feature_support.md
This was referenced Nov 21, 2026
Closed
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.
Fixes #342
Fixes #344
Fixes #345
Fixes #348
Fixes #361
Partitions and inheritance children lost what they have of their own on pull/rebuild. Every probe fixture now rebuilds with a matching pg_dump on 17, 18 and 19 (f8_am also on 17, f23b_genpart on 17–19, f21_odd and f9_cons on 18–19).
#342: access methods
USING: the access method of the closest ancestor that has one (17+), elsedefault_table_access_method. Aheappartition under a parent on a custom method now getsaccessMethod: heap. A partition whose method matches its parent's no longer gets the key written. A partitioned table set explicitly to the default now gets it written.accessMethodstays unmanaged, as before.CREATE ACCESS METHODhas no YAML), through the existing unsupported-objects warnings.#344: NOT NULL NO INHERIT
notNullNoInherit: true. It is introspected fromconnoinherit.NOT NULL NO INHERITin CREATE and ADD COLUMN,ADD CONSTRAINT ... NOT NULL col NO INHERIT [NOT VALID]when the constraint is added, andALTER CONSTRAINT ... [NO] INHERITto change an existing one (18+).nullable: false, it applies to the NOT NULL constraint the child adds itself. Pull treats a parent's NO INHERIT constraint as nullable for its children.pgy validaterejects the key on a partitioned table and warns on a nullable column. There is a version warning before 18.#345: generation expressions a partition or child overrides
generatedon an inherited column whose expression differs from its parent's.PARTITION OF parent (col GENERATED ALWAYS AS (...) STORED|VIRTUAL), using the parent's kind. For an inheritance child, the column is written with the parent's type and collation, and PostgreSQL merges it, soattislocalmatches the source. pg_dump leaves out a non-local override entirely, so a rebuild throughSET EXPRESSIONalone would have looked lossy.ALTER TABLE ONLY ... SET EXPRESSION(17+, under--unsafelike a declared column, with a warning before 17).ONLYleaves grandchildren alone. A parent's changed expression recurses into its partitions and children, so the ones that declare their own get it set again after it.#348: validity of an inherited NOT NULL NOT VALID
notValid: falseon an inherited column whose copy is validated while the parent's isn't.notValidnow records whether it was written (NotValidSet).VALIDATE CONSTRAINTafter the parent's constraint is added, or in the no-transaction migration for an existing table.#361 (found along the way): NOT NULL names of partitions and children
notNullNameon such a copy. Diff names it in the CREATE (PARTITION OF parent (col CONSTRAINT name NOT NULL), or the full column for a child).notNullNameis ignored on partitions and children is gone.Tests
TestIntegrationInheritedGeneratedOverrides(17+),TestIntegrationNotNullNoInheritAltered(18+), and an extendedTestIntegrationAccessMethods.generated_overrides.sql(16+) andnot_null_inheritance.sql(18+). The fixture runner now skips a fixture whose first line is-- requires server_version_num Non older servers.make test,go vet ./..., and the integration suites (./internal/cli/... ./internal/integration/...with PL and pg_dump) pass on PostgreSQL 15, 17, 18 and 19.