top of page

Why Does a Change Report Miss Values That Were Added or Cleared?

Oct 26
3 min read

A nightly comparison finds records whose owner changed from one person to another, yet misses records that gained their first owner or had their owner removed. The report uses old_owner <> new_owner. The condition looks natural, but missing values do not behave like ordinary text in SQL comparisons.


The goal is not simply to make NULL equal a convenient placeholder. The goal is to define which transitions count as changes and express that definition without losing meaningful cases. A small transition matrix is usually more useful than debugging a long export.


Define the comparison you actually need


PostgreSQL's comparison documentation explains that ordinary comparisons involving NULL produce unknown. IS DISTINCT FROM treats one missing and one present value as different, while two missing values are not distinct.


For a scalar field, old_owner IS DISTINCT FROM new_owner can therefore express a change detector that includes additions and clearings. The inverse, IS NOT DISTINCT FROM, expresses equality under that particular missing-value treatment.


This is a comparison policy, not proof that two unknown identities refer to the same person. Use it only where the business interpretation fits the purpose of the report.


Write the transition matrix before the query


Illustrative example: owner assignments


Use five cases: “Ari” to “Bea” should appear; “Ari” to “Ari” should not; NULL to “Ari” should appear; “Ari” to NULL should appear; NULL to NULL should not. Include the expected action beside each pair.


Run the same fixture through both the original and proposed predicates. If the first and last names are real personal information, replace them with fictional fixture values. The test needs representative transitions, not a copy of a production contact list.


Keep empty text separate


Add an empty string to the fixture only after deciding what it means. NULL and an empty string are distinct values under the proposed comparison. If the source uses both to mean “unassigned”, normalize that representation through an explicit, reviewed rule before comparing.


Do not use a magic replacement such as “UNKNOWN” unless that value is excluded from valid data. Otherwise a genuinely stored value can become indistinguishable from an absent one.


Establish a reliable old and new record pair


A correct predicate cannot repair a join that matches the wrong records. Compare versions using the stable business or system identifier intended for that dataset. Review missing records separately from missing fields.


For example, a record absent from today's extract may have been deleted, filtered out or skipped by an incomplete export. Treating its entire new row as NULL can turn an extraction failure into an apparent clearing of every field.


Keep three categories in the report: paired records with changed fields, records only in the earlier extract, and records only in the later extract. Investigate the latter categories under the extraction and lifecycle rules.


Decide which changes deserve an action


A detected difference is evidence of a value transition. It does not automatically justify notifying a customer or overwriting another system. Some changes are corrections, some are normalization differences, and some are temporary source states.


Attach the relevant field policy to each downstream action. For an owner assignment, a reviewer may need the previous owner, proposed owner, source timestamp and record identifier. For descriptive text, a simple audit entry may be enough.


If several fields change together, preserve their shared version context. Reviewing an owner from one snapshot alongside a status from another can produce a combination that never existed in the source.


Keep the report's claim narrow


Name the output “detected differences between these two extracts” unless stronger evidence supports a full change history. Multiple transitions between extracts will not necessarily be visible, even when the final comparison is correct.


Retain the transition fixture and source-version labels with the query. Recheck them after a field mapping or normalization change. The related guide on missing, null and empty update values helps distinguish representation from intent.


For a FutureOS brief, describe the transition that was missed and provide an anonymized before-and-after pair. That gives collaborators a precise acceptance test instead of a vague request to improve synchronization.


Editorial note


Editorial note: This article was prepared with AI assistance. Primary sources and the linked FutureOS article inventory were checked on October 26, 2026. Examples are illustrative and are not customer results. The current FutureOS introduction describes the project as being in prelaunch; this guide does not assert that a particular product feature, integration or service is available. The procedures are practical proposals to adapt and test in your own setting. No independent expert review is claimed. Start with a specific question, your relevant constraints and a small example of the result you need.


Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.
bottom of page