Validating Data from PostgreSQL

This page covers PostgreSQL-specific setup for Data validation. For workflow field definitions, see Data validation configuration reference.

Prerequisites

Connectivity

Reuse [connections.source.postgresql] Worker TOML from data migration:

[connections.source.postgresql]
auth_method = "standard"
username = "scai"
password = "your_password"
database = "analytics"
host = "db.example.com"
port = "5432"
ssl_mode = "Require"
use_copy = true

Set source_platform: postgresql in the validation workflow YAML. Set ssl_mode in Worker TOML to match your PostgreSQL host’s TLS requirement (Disable, Allow, Prefer, Require, or VerifyFull).

Example workflow excerpt:

source_platform: postgresql
target_database: TARGET_DB
schema_mappings:
  public: PUBLIC
validation_configuration:
  schema_validation: true
  metrics_validation: true
  row_validation: false
tables:
  - fully_qualified_name: public.customers
    column_names_to_partition_by:
      - customer_id
  - fully_qualified_name: public.orders
    column_names_to_partition_by:
      - order_id
    index_column_list:
      - order_id
    validation_configuration:
      row_validation: true

Data type mappings

PostgreSQL typeSnowflake target typeSupported for validationNotes
integer, bigint, numeric, decimalNUMBERYes
real, double precisionFLOATYes
booleanBOOLEANYes
dateDATEYes
time, timestamp typesTIME / TIMESTAMPYes
character varying, textVARCHARYes
byteaBINARYYes
uuidVARCHARYes
json, jsonb, xmlVARIANTNo
moneyNUMBERNo
bit, bit varyingBINARYNo
pointGEOMETRYNo
oidVARCHARNo
interval, range typesVARCHARNoCompared as VARCHAR text
PostGIS geometry/geographyGEOMETRY / GEOGRAPHYNo

Platform-specific suggestions

  • Confirm the Worker’s ssl_mode matches your PostgreSQL host before running validation workflows; a mismatch fails connectivity, not just validation.
  • use_copy = true speeds up source reads on large tables; confirm your role and network allow the PostgreSQL COPY path.
  • Anti-locking: No automatic hint is added on PostgreSQL. Set queryModifiers only when you need custom source SQL hints. See Anti-locking and query modifiers.