Skip to content

Incorrect Aggregation in Schema Diff Summary #9892

@faharabbas-bug-hunter

Description

@faharabbas-bug-hunter

Summary
The "Schema Objects" parent node in the results tree displays "Different: 0", even though multiple child categories (Functions, Procedures, Sequences, Tables, and Types) contain objects that exist only in the Source or Target.

Description
In the Schema Diff tool, the top-level group should reflect the status of its children. In the provided image:
• Functions: Has 7 Source Only and 1 Target Only objects.
• Tables: Has 6 Source Only objects.
• ...and so on.
The top-level "Schema Objects" row shows Different: 0, Source Only: [Blank], and Target Only: [Blank]. While technically the objects are "Source Only" rather than "Different" (modified), a standard UI expectation is that the parent node should either:

  1. Sum the counts of all differences/mismatches below it.
  2. Highlight that differences exist so the user doesn't have to expand every single folder to find them.

Steps to Reproduce

  1. Open pgAdmin 4.
  2. Navigate to Tools > Schema Diff.
  3. Select a Source database/schema and a Target database/schema that have mismatched objects (e.g., tables that exist in Source but not Target).
  4. Click Compare.
  5. Observe the "Schema Objects" summary row.

Expected Behavior
The Schema Objects row should aggregate the statistics of its children. For example:
• Different: Should be the sum of all "Different" counts.
• Source Only: Should display the total count of all objects existing only in the source (e.g., $7 + 1 + 3 + 6 + 1 = 18$).
• Target Only: Should display the total count of all objects existing only in the target (e.g., $1$).

Actual Behavior
The parent node "Schema Objects" remains at 0 for all columns or leaves them blank, providing no visual indication of the mismatches contained within the sub-folders unless they are manually expanded.


Suggested Priority
• Severity: (It is a UI/Reporting bug; the underlying DDL comparison likely still works, but it causes poor visibility).
• Component: pgAdmin 4 - Schema Diff Plugin.

Environment Information
• pgAdmin 4 Version: (9.14)
• Mode: Desktop / Server (whichever you are using)
• OS: All
• PostgreSQL Version: (e.g., postgresql-18.3-3-windows-x64)

Snapshot:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions