Skip to main content

PostgreSQL to Snowflake — investigate data differences and performance

A common goal is to move PostgreSQL reporting work into Snowflake while the application continues to use PostgreSQL. In that scenario the warehouse is an analytical copy, not a replacement transaction system. Define the required reporting freshness and reconciliation boundary before choosing the final acceptance check.

Investigate a late revenue report​

Consider a subscription company moving daily revenue reporting off its PostgreSQL application database. The first Snowflake report finishes quickly, but yesterday's revenue is lower and a handful of enterprise customers appear twice. The load job succeeded. That establishes delivery activity, not business equivalence.

The investigation starts with a closed order cohort and a documented update watermark. Preserve the raw landing values, then compare a business projection keyed by order_id. For the customer dimension, establish whether the report expects one current customer row or historical versions. Joining every historical version to an order can multiply revenue even when both individual tables were copied correctly.

Incident signalFocused experimentAcceptance evidence
Orders cross the reporting-day boundaryProject the same business-day calculation from each timestamp; inspect orders around midnight and daylight-saving transitionsEvery order belongs to the approved reporting day; raw instants remain recoverable
High-value amounts disagreeCompare exact database-native decimal totals by currency, then inspect disputed keysExact amounts and approved scale agree; a floating comparison alone cannot sign off money
Customer rows multiply in reportsCompare a projection at the final report grain and check dimension join cardinalityOne expected output row per business key, with approved history handling
JSON attributes become blankProject specific JSONB/VARIANT paths and distinguish absent fields, null and empty textRequired attributes retain their meaning, including nested optional fields
Older refunded orders remain unchangedReconcile updated historical orders and tombstones against the final applied loadLate updates and deletions appear in the same agreed scope

These are investigation hypotheses, not automatic SmartDiff classifications. In particular, a time shift may appear as changed cell values; the operator must connect it to timezone handling. Snowflake's timestamp type definitions distinguish stored and displayed time semantics. Write the intended business interpretation before normalizing away a difference.

Start with a concrete table contract​

For an illustrative orders dataset, map PostgreSQL sales.orders to Snowflake ANALYTICS.SALES.ORDERS. Preserve order_id, customer_id, currency, amount, and the original event timestamp in the landing representation. Record any renamed columns and deliberately added ingestion fields. Use the business key for comparison; a newly generated warehouse surrogate key is not automatically the same identity.

Check unique, non-null keys in both selected scopes. Capture a consistent extraction boundary and its corresponding completed target load. When writes continue, include updates to older orders and deletes in the reconciliation, not just rows with a recent creation date.

Resolve the mappings that matter​

Source concernDecision before accepting the target
numeric precision and scaleSpecify a target decimal definition and test values near its limits. Reconcile exact financial values separately from DataDios floating-point comparison.
timestamp versus timestamptzDecide whether the field is a local wall-clock value or an instant. Choose the target type and timezone conversion accordingly.
JSON/JSONB and arraysDefine the fields and array-order semantics the business uses. Compare an approved projection rather than assuming serialized JSON equality.
Case-sensitive identifiersRecord exact qualified names and reviewed column pairs. Resolve case-only ambiguities before comparison.
Sequences and generated defaultsValidate existing loaded keys and separately test how future records will be created if the target will accept writes.

Snowflake distinguishes timezone-free and timezone-aware timestamp types; consult its date/time reference. Its PostgreSQL translation reference is an input to mapping design, not a guarantee about the tool used for your load.

Validate the landing data, then reporting​

Create the PostgreSQL connection and follow the Snowflake access and validation steps. This pair uses SmartDiff-enabled connector types, but this article does not report a live pair benchmark. Prove the mappings in a representative pilot.

Compare the agreed snapshot tables through Data Source Diff, with explicit table, column and key mapping. For row predicates or approved projections, use Query Diff with equivalent scopes. DataDios metadata filters do not supply row cutoffs. Apply the batching and precision boundaries before expanding coverage.

After the landing comparison, validate daily sales totals by currency and status, distinct customer counts, and late changes against the reports people use. A correct raw copy can still produce the wrong report after a timezone or join change.

Read a synthetic result without losing the evidence​

Suppose an aligned, unique-key cohort contains 10,020 distinct keys across both sides: 9,800 matching rows, 180 shared keys with changed values, 30 keys only in PostgreSQL and 10 only in Snowflake. The source has 10,010 rows and the target 9,990. The comparison has 220 differing rows, including the one-sided rows. These are invented training numbers, not a DataDios benchmark or an observed customer result.

Start with the overall counts and select the affected table. SmartDiff groups differences by combinations of labels, exposes key-linked examples and highlights changed text. Use Only diffs, Diff by column, and inline or side-by-side views to isolate amount, event time or projected JSON attributes. A rounding or null-related label narrows inspection; it does not explain the pipeline decision that caused it.

The Summary tab compares value frequencies between sides. A sudden increase in a blank customer segment is useful evidence even before inspecting every individual key. The Metadata tab helps review representation changes. These are computed summaries, not an AI-written explanation. Counts for missing rows, changed columns and cluster labels can overlap: never add every badge to derive another total. Use the overall diff count and document which grouping each breakdown represents.

SmartDiff result interface showing highlighted comparison evidence

Actual product screenshot from a SQL Server → PostgreSQL demo. It illustrates the result interface, not a PostgreSQL → Snowflake execution or the synthetic cohort above.

Export the selected table's available CSV/PDF evidence with its scope and filters. Standard result detail can be sampled to at most 1,000 rows per cluster even when counts cover the compared population. An export of displayed evidence is not proof that every exceptional row was included. Retain the exact reconciliation queries for complete financial checks. The investigation and performance guide explains this review sequence across migration pairs.

Establish performance before and after offload​

Before switching reports, enable supported workload collection and check prerequisites on both connections. PostgreSQL query statistics need installed and preloaded pg_stat_statements; establish the first collection baseline before interpreting activity deltas. In Performance Analyzer, inspect PostgreSQL waits, connection activity and query execution evidence over the reporting window. Identify whether reporting pressure coincides with application latency; a high execution total alone may just mean a query ran often. PostgreSQL's statement statistics include calls and accumulated execution time. Keep reset boundaries and workload volume with the baseline.

After offload, compare equivalent report inputs, concurrent users, freshness and cache conditions. On Snowflake, investigate queueing separately from execution, then inspect scanning and spill where available; use native Query Profile for operator-level details. A cold warehouse start and a query scanning too many partitions require different remedies. The Snowflake execution-time guide explains where query-history and profile evidence fit.

Do not compare PostgreSQL cumulative execution time directly with a single Snowflake execution. Record report completion with an external repeatable harness, while using Performance Analyzer to explain each engine's behavior. A candidate outcome is reduced application contention with reports meeting their freshness deadline at an acceptable warehouse cost—not merely a faster isolated query.

Example acceptance record​

DecisionEvidence to attach
Data readinessCohort definition, load watermark, reviewed keys/mappings, corrected diff rerun and remaining exceptions
Revenue readinessExact totals by currency and business date, plus refund and customer-join checks
Performance readinessComparable report executions, PostgreSQL source-pressure baseline, Snowflake queue/scan investigation and warehouse configuration
Release ownershipFinance approval of reporting semantics, engineering approval of load completeness, rollback owner and deadline

In the synthetic incident, the first run is not accepted. Correct the join and timezone interpretation, reload affected records, and rerun the same cohort before expanding. A named exception must describe business impact; a high overall match percentage cannot waive missing invoices or revenue.

Cutover and value​

For analytics offload, switch a small set of reports first and compare freshness and outputs across a complete business cycle. If the project also replaces an application dependency, add behavior and recovery tests; row equality cannot establish application compatibility.

Record missing keys, unexpected keys, changed values, validated scope and exceptions. Measure time spent reconciling each reporting period and the source workload relieved by the move. Compare equivalent periods and include Snowflake validation compute in the cost calculation.

Review your PostgreSQL to Snowflake plan