-
Notifications
You must be signed in to change notification settings - Fork 726
PG18 - Make regression tests resilient to PG18 foreign key name changes #8127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a2d6f26
to
3025c41
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (0.00%) is below the target coverage (87.50%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #8127 +/- ##
==========================================
- Coverage 86.82% 0.00% -86.83%
==========================================
Files 287 287
Lines 63087 63110 +23
Branches 7929 7903 -26
==========================================
- Hits 54775 0 -54775
- Misses 5767 63110 +57343
+ Partials 2545 0 -2545 🚀 New features to boost your workflow:
|
3025c41
to
e8cbae2
Compare
e8cbae2
to
4ca7775
Compare
af019ba
to
fbd0800
Compare
Pg18 beta conf file updated (cherry picked from commit c36410c) Update image suffix in build and test workflow Update image suffix in build configuration Update image suffix in build configuration Update image suffix in build configuration (cherry picked from commit 7dbb946) Update image suffix in build_and_test.yml to reflect latest development version Update PostgreSQL version to 18beta3 in Dockerfile and CI workflow Pg18 beta conf file updated Pg18 beta conf file updated (cherry picked from commit c36410c) Update image suffix in build and test workflow Update image suffix in build configuration Update image suffix in build configuration Update image suffix in build configuration (cherry picked from commit 7dbb946) Update image suffix in build_and_test.yml to reflect latest development version
fbd0800
to
7d59914
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the regression tests to be resilient to PostgreSQL 18's foreign key name changes for partitioned tables. PostgreSQL 18 introduced upstream changes that cause foreign key names to change (e.g., sensors_8970000_measureid_eventdatetime_fkey
→ fkey_from_parent_to_parent_8970000_1
) even when the underlying constraints are identical.
- Updated
table_fkeys
view to replace the constraint name column with a dummy boolean column - Modified test queries to sort by relationship and definition instead of volatile constraint names
- Added PostgreSQL 18 support to CI/CD configuration
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/test/regress/sql/multi_test_catalog_views.sql | Updated table_fkeys view to use TRUE placeholder instead of constraint names |
src/test/regress/sql/multi_colocated_shard_rebalance.sql | Modified FK query to filter by table names and FK definitions |
src/test/regress/sql/citus_split_shard_columnar_partitioned.sql | Updated ORDER BY clauses to sort by column 3 instead of 2 |
src/test/regress/sql/citus_non_blocking_split_columnar.sql | Updated ORDER BY clauses to sort by column 3 instead of 2 |
src/test/regress/expected/*.out | Updated test expectations to show 't' for constraint column |
configure.ac | Added PostgreSQL 18 version compatibility check |
configure | Generated configure script with PG 18 support |
.github/workflows/build_and_test.yml | Added PostgreSQL 18 to CI matrix and updated versions |
.github/workflows/packaging-test-pipelines.yml | Fixed regex for extracting PG versions |
.devcontainer/Dockerfile | Added PostgreSQL 18beta3 build stage |
citus-tools | Added submodule reference |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
53af9491a0439720094a11b72602952d79f59ac7
7d59914
to
80e5421
Compare
fixes #8126
PostgreSQL 18 introduced upstream changes to foreign key propagation and naming for partitioned tables (commit
[53af9491a0](https://github.com/postgres/postgres/commit/53af9491a0439720094a11b72602952d79f59ac7)
), causing foreign key names to change even when the underlying constraints are identical. Examples in our regression tests include:These name changes are purely cosmetic but cause false test failures because our current queries assert directly on
fk."Constraint"
.Updated
table_fkeys
view:constraint_name
with a dummy boolean column (t
) to indicate existence.FOREIGN KEY (…) REFERENCES …
text as the stable representation.Adjusted regression test queries:
relname
andDefinition
instead of the volatile constraint name column.relid::regclass
) and referenced table in theDefinition
.With these changes: