Conversation
nettrash
commented
Jul 18, 2026
Owner
Contributor
There was a problem hiding this comment.
Pull request overview
Release v1.0.25 focusing on hardening dump/compare output against PostgreSQL catalog quirks and non-idempotent deparsing, with regression fixtures and CI checks to prevent reintroduction.
Changes:
- Exclude all
pg_%schemas during schema resolution; fix view dumping/dependency resolution via_RETURNrewrite-rule dependencies (incl. function-only views) and capture view output columns to decideOR REPLACEvs drop+recreate. - Canonicalize catalog-stored SQL definitions (views, indexes, constraints, generated columns) to eliminate infinite diff loops from non-idempotent
IN (...)deparsing; fixWITH NO DATAand trailing view clause placement. - Fix partition/index/reloption edge cases: strip
ON ONLYfor non-production partitioned-parent indexes, preserve partition reloptions onPARTITION OF, and avoid emitting ADD/DROP for PG18 auto-named NOT NULL constraints; improve routineSETemission for list-quoted GUCs.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| data/test/schema_a.sql | Adds regression fixtures for issues #216/#217/#218/#219/#220/#223/#226/#227. |
| data/test/schema_b.sql | Companion “TO” fixtures for the same regression set. |
| data/test/README.md | Documents new regression cases and expected behavior. |
| CHANGELOG | Adds v1.0.25 release notes. |
| app/src/utils/string_extensions.rs | Adds unquote_ident() helper for aligning quoted vs raw catalog identifiers. |
| app/src/utils/string_extensions_tests.rs | Adds unit tests for unquote_ident(). |
| app/src/utils/sql_normalize.rs | Introduces canonicalization of catalog SQL to stabilize hashing/comparison. |
| app/src/utils/sql_normalize_tests.rs | Extensive tests covering IN-list cast normalization and quote safety. |
| app/src/utils/mod.rs | Exposes the new sql_normalize module. |
| app/src/dump/view.rs | Adds view column capture + OR REPLACE compatibility check; fixes semicolon/clause placement; supports matview WITH NO DATA; canonicalizes definitions for hash/compare. |
| app/src/dump/view_tests.rs | Tests for clause placement, WITH NO DATA, and OR REPLACE compatibility behavior. |
| app/src/dump/table.rs | Emits reloptions on PARTITION OF; uses indexdef equivalence; skips auto-named NOT NULL constraints in add/drop. |
| app/src/dump/table_tests.rs | Tests reloptions-on-partitions and auto NOT NULL constraint suppression. |
| app/src/dump/table_index.rs | Canonicalizes index hashing/comparison; strips ON ONLY in emitted SQL; adds indexdefs_equivalent(). |
| app/src/dump/table_index_tests.rs | Tests ON ONLY stripping and equivalence behavior. |
| app/src/dump/table_constraint.rs | Switches constraint normalization to shared SQL canonicalizer. |
| app/src/dump/table_constraint_tests.rs | Updates expectations to element-level fixed-point canonical form. |
| app/src/dump/table_column.rs | Canonicalizes generated column expressions for hash/equality. |
| app/src/dump/routine.rs | Emits list-quoted GUCs verbatim; fixes quoting logic for scalar values. |
| app/src/dump/routine_tests.rs | Tests list-GUC verbatim emission and scalar quoting/escaping cases. |
| app/src/dump/core.rs | Centralizes schema query and excludes pg_%; fixes view relation resolution via pg_rewrite/pg_depend; captures view columns; reads matview ispopulated; qualifies format_type. |
| app/src/dump/core_tests.rs | Adds regression tests for view dump query, schema filtering, dependency resolution, and collation capture. |
| app/src/comparer/core.rs | Drops/recreates incompatible view column changes; expands drop set transitively; optimizes dependency checks. |
| app/src/comparer/core_tests.rs | Adds tests for incompatible view changes and dependent drop ordering; updates routine SET expectations. |
| app/Cargo.toml | Bumps crate version to 1.0.25. |
| app/Cargo.lock | Updates lockfile version for pgc. |
| .github/workflows/rust.yml | Adds CI assertion to fail if any non-system index remains indisvalid=false after migration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.