Skip to main content

PRODUCT WALKTHROUGH

Accept the migration with evidence.

Counts are a starting point. Validate keys, values and the business contract before cutover.

Agree which systems and cutoff you compare. Source and target.
Product capture · demonstration data · V2 interfaceOpen full-size screen ↗
Agree which systems and cutoff you compare.

This capture compares SQL Server with PostgreSQL. Align snapshots, keys and allowed transformations before reading differences.

Marked on screen: Source and target.
Worked example, setup and reference details

Compare tables by a unique, non-null key and check values with null-aware comparisons. Report rows missing from either side separately from rows whose values changed. Row counts alone miss replacements and value changes.

Before you compare​

Choose the same snapshot or agreed cutoff, select columns explicitly, and verify that the key is unique and non-null on both sides. If keys are duplicated, resolve them or define a composite key before joining; otherwise the join can multiply rows and mislead your counts. Decide whether case, whitespace, and rounding differences are meaningful before applying transformations.

A self-contained PostgreSQL example​

Run this read-only example in PostgreSQL 18. It uses small inline tables and requires no existing tables. It is ordinary SQL, not a SmartDiff expression or an instruction to query production.

WITH source_orders(order_id, amount) AS (
VALUES (101, 25.00::numeric), (102, 40.00), (103, 10.00)
), target_orders(order_id, amount) AS (
VALUES (101, 25.00::numeric), (102, 39.00), (104, 11.00)
)
SELECT COALESCE(s.order_id, t.order_id) AS order_id,
s.amount AS source_amount,
t.amount AS target_amount,
CASE
WHEN s.order_id IS NULL THEN 'target_only'
WHEN t.order_id IS NULL THEN 'source_only'
ELSE 'value_changed'
END AS difference
FROM source_orders s
FULL OUTER JOIN target_orders t ON s.order_id = t.order_id
WHERE s.order_id IS NULL
OR t.order_id IS NULL
OR s.amount IS DISTINCT FROM t.amount
ORDER BY order_id;

Expected results:

order_idsource_amounttarget_amountdifference
10240.0039.00value_changed
10310.00NULLsource_only
104NULL11.00target_only

Order 101 is absent because it matches. IS DISTINCT FROM detects a value versus null and treats two nulls as equal. Ordinary <> does not provide that behavior. The missing-side test relies on the non-null key requirement.

PostgreSQL documents the full outer join, null-aware predicates, and inline VALUES tables.

Adapt it to your data​

Replace the inline tables with approved comparison snapshots. Add a null-aware comparison for each selected column. Check key uniqueness with a grouped count and check null keys separately before running the join.

For separate database servers, this query cannot access both automatically. You need an approved staging or federation method, or a comparison workflow that connects to each system. Adapt SQL syntax to the database engine; do not assume every engine supports these PostgreSQL operators.

A full comparison can be expensive. Start with a bounded partition, review the execution plan, then process all agreed partitions with appropriate indexes and resource limits. Do not export sensitive records to an unapproved location.

When the values look equivalent​

See the mismatch investigation guide for nulls, decimal precision, and timestamps. Keep any excluded columns and normalization rules in the validation record.

For DataDios setup, follow SmartDiff Data Source Diff. For cutover planning, use the migration validation checklist.

Discuss source-to-target comparison