Skip to main content

PostgreSQL to Redshift — investigate migration defects and reporting performance

A distributor moves regional sales reporting from PostgreSQL into Redshift so large scans no longer compete with order entry. The first dashboard loads quickly, but the French subsidiary's customer count falls and unit-price totals change. Both tables have roughly the expected row count. The migration team needs to explain the missing customers and the financial difference before switching reports.

This is an illustrative customer scenario, not a measured migration. It shows why record counts, business semantics and workload behavior need separate acceptance evidence.

Current DataDios boundary

Redshift is not currently enabled in the SmartDiff connection picker and does not have the Performance Analyzer workload collection described for PostgreSQL. Use native source/target reconciliation for this pair. DataDios can support the eligible PostgreSQL source-side investigation; do not expect direct Redshift SmartDiff clusters or native Redshift workload charts.

Define the reporting contract​

The first wave covers one closed sales month: sales.orders, sales.order_lines and crm.customers. Retain source order_id, the composite line key (order_id, line_number), and customer_id in the target. The business report groups net sales by region, currency and business day. A customer with two orders is one customer, two orders and several lines; specify the correct grain for each check.

Record the PostgreSQL snapshot or reconciled extraction watermark and completed Redshift load. Include a cancellation and a correction to an older order. Counts restricted to newly created rows would miss both. Before comparing, confirm that source and target keys are non-null and unique at the selected grain. Keep rejected-load rows in the evidence trail rather than counting only successfully loaded records.

Real failure patterns to test​

Failure patternWhat the customer seesInvestigation and acceptance check
Character lengths become byte limitsMultilingual names fail while ASCII names loadCompare byte lengths, rejected rows and missing customer keys; test accented and multibyte boundary values
A copied TEXT definition becomes too narrowLong product descriptions disappear or fail ingestionChoose an explicit target width or storage design; reconcile rejects and the original content
Decimal scale was omittedFractional prices become whole numbersInspect target precision/scale and native exact differences; reconcile totals by currency and tax treatment
Trailing-space semantics alter identifiersTwo source groups collapse in a warehouse reportCompare raw value plus length and the actual grouping/join result; approve identity normalization explicitly
A retry introduces duplicate keysSales double for a subset of invoicesVerify key multiplicity before declaring constraints, then inspect the load/replay boundary
Incremental deletes are absentCanceled orders remain in revenueReconcile source-only/target-only keys across the agreed change boundary and inspect the pipeline's delete handling

PostgreSQL character limits and Redshift byte limits are not interchangeable. Redshift also maps TEXT to VARCHAR(256) and ignores trailing spaces in character comparisons. These rules make both load checks and downstream join tests necessary. See PostgreSQL character types and Redshift character types.

Redshift numeric definitions default to scale zero if scale is omitted. Make the intended scale explicit before loading rather than “fixing” validation with a tolerance. Its key constraints are informational and can affect query planning, so a declared primary key is not a uniqueness check. See numeric types and constraint semantics.

Work the discrepancy instead of accepting a headline count​

Suppose a synthetic pilot has 20,000 source customers. A native reconciliation finds 28 absent target keys. The load rejects contain long UTF-8 names for those keys. Separately, 16 order-line keys have changed unit prices after an unintended scale-zero cast. Twelve canceled order keys still exist in the target. These are different failures with different owners; a single “accuracy” number would obscure the corrective actions.

  1. Retain the raw extracts. Run approved read-only queries separately on PostgreSQL and Redshift at the same closed scope. Include stable keys, original scalar values and lengths/types needed to explain discrepancies. Preserve exact decimal values through the comparison process.
  2. Group the native reconciliation results. Group absent customer keys by load-reject reason and text length; changed price keys by source/target scale; retained cancellations by change batch. This is a customer-run analysis, not a Redshift SmartDiff cluster feature.
  3. Confirm one cause per cohort. Inspect examples that do and do not fit the hypothesis. A long name is not proof of truncation if the loader instead rejected the whole record. Check the actual load diagnostics.
  4. Repair the cause. Adjust the target width and reload rejected customer rows; restore the intended price scale; repair and replay the bounded delete interval. Each action uses the migration pipeline's normal change process.
  5. Repeat row and report checks. Verify missing/unexpected keys and changed values again, then rerun regional customer counts and net sales by currency. A repaired table can still feed an incorrect join.

For supported connector pairs, SmartDiff supplies pattern clusters, highlighted examples and frequency summaries for this style of investigation. The shared method explains those features, but their availability elsewhere must not be mistaken for Redshift execution support.

Compare the reporting workload, not the database names​

The performance goal is to reduce report interference with order entry while keeping the warehouse report within its freshness and response-time requirement. Test the same accepted month, report parameters, output and representative concurrency. Keep source application traffic, target cluster/Serverless configuration and warm/cold result-cache state in the run record.

PostgreSQL evidence in DataDios: enable workload analysis and verify pg_stat_statements is installed/preloaded and collection is healthy. Use execution totals and calls to identify expensive reporting queries, and sampled wait/load evidence to understand their effect on the application. Establish a collection baseline. A maximum since statistics reset is not the maximum from this test window; use independently recorded repeated-run timings for end-to-end latency.

Redshift evidence outside DataDios: use AWS query history for elapsed, execution and queue time, returned rows and cache-hit state. SYS_QUERY_HISTORY timing fields are in microseconds. Use query details and the plan to investigate scans, redistribution and spill; do not infer those mechanisms from elapsed time alone. See AWS query history and query detail.

For example, if the monthly report is fast alone but misses its deadline during the morning refresh, distinguish queue time from execution time. If execution is expensive, inspect distribution and join movement for the accepted fact/dimension population. Consider a physical-design change only after measuring the relevant join; copying PostgreSQL indexes is not a Redshift design strategy. Repeat the same workload after the change and reconfirm the report output. AWS describes distribution styles.

Keep the PostgreSQL DataDios baseline beside the native Redshift evidence in the project record. There is no automatic cross-engine query pairing, plan diff or normalized speed score. Compare source application health, target report latency and billable resources separately.

What the release decision should say​

Illustrative review: Closed month M1, customer/order/line scopes and mapping v4 recorded. The 28 rejected customer keys have been reloaded, 16 line-price conversions repaired, and 12 cancellations reconciled. Exact currency totals and report group counts must pass on the full scope. The workload gate requires acceptable order-entry latency during offload, the agreed warehouse report deadline at peak demand, and a reviewed resource budget. Retain run IDs and owners before marking either gate complete.

Those are proposed evidence fields, not a claim that the example checks were run. An enterprise can split responsibility among ingestion, database, finance and warehouse teams. A small distributor can start with one month and its two most consequential reports. Measure reconciliation hours, time to resolve rejected cohorts, application interference and the cost of operating both platforms until cutover.

Review your PostgreSQL to Redshift requirements