Start for Free Schedule a Demo

Handling Column Widening and Data Type Changes with Hevo

A hands-on walkthrough of how Hevo carries a wider numeric column from PostgreSQL into Snowflake, including a scale increase Snowflake cannot apply with a plain ALTER COLUMN.

Written by
Nitin Bindal · Software Development Engineer - III
December 3, 2026  ·  6 mins
Handling Column Widening and Data Type Changes with Hevo

Overview

When applications and business needs change, the source data structure can also change. A column that originally holds numeric values may later need to hold larger numbers, a different data type, or more decimal precision.

These changes need to be reflected in the destination without disrupting existing data pipelines.

Hevo handles supported source-side data type changes and column widening by detecting schema changes and applying the corresponding updates at the destination. This allows pipelines to adapt as source data evolves, without requiring manual destination schema modifications.

Let's look at how this works with a PostgreSQL-to-Snowflake pipeline.

Let's Take a Scenario

Consider a wholesale business that manages customer orders in PostgreSQL and replicates its data into Snowflake for reporting and analysis.

At first, the business keeps order totals rounded to two decimal places. As the finance team wants to dig deeper into the numbers, they now need to keep four decimal places. This detail helps them handle taxes, discounts, and cost allocations with accuracy.

To support this, the engineering team changes the o_totalprice column in the PostgreSQL orders table from NUMERIC(15,2) to NUMERIC(18,4).

This is one example of how a source column can evolve. Let's see how Hevo handles the change and keeps the destination schema in sync.

Handling Column Widening and Data Type Changes with Hevo
Watch Hevo widen a numeric column from NUMERIC(15,2) to NUMERIC(18,4) in Snowflake, end to end.

See It in Action

Step 1: Check the Existing Schema and Data

We begin with an existing PostgreSQL-to-Snowflake pipeline replicating the orders table.

First, inspect the source column definition:

PostgreSQL
1SELECT
2 column_name,
3 data_type,
4 numeric_precision,
5 numeric_scale
6FROM information_schema.columns
7WHERE table_schema = 'tpch1g'
8 AND table_name = 'orders'
9 AND column_name = 'o_totalprice';

The column currently uses NUMERIC(15,2).

Before the change: o_totalprice is NUMERIC with precision 15 and scale 2 in PostgreSQL.
Before the change: o_totalprice is NUMERIC with precision 15 and scale 2 in PostgreSQL.
Text version

PostgreSQL (DbVisualizer): column definition of tpch1g.orders.o_totalprice before the change

SELECT
    column_name,
    data_type,
    numeric_precision,
    numeric_scale
FROM information_schema.columns
WHERE table_schema = 'tpch1g'
  AND table_name = 'orders'
  AND column_name = 'o_totalprice';

Result: 1 row (0.376 sec)

column_name data_type numeric_precision numeric_scale
o_totalprice numeric 15 2

The column is NUMERIC(15,2).

Next, check the corresponding destination definition:

Snowflake
1DESC TABLE YOUR_DATABASE.YOUR_SCHEMA.ORDERS;

In Snowflake, the column is represented as NUMBER(15,2).

Before the change: O_TOTALPRICE is NUMBER(15,2) in Snowflake, the 4th column of ORDERS.
Before the change: O_TOTALPRICE is NUMBER(15,2) in Snowflake, the 4th column of ORDERS.
Text version

Snowflake: DESC TABLE SOLUTIONS_ENGINEERING_POC.TPCHV2__TPCH1G.ORDERS; before the change: 14 rows (74 ms); the first 6 are visible

# name type kind null? primary key unique key
1 O_ORDERKEY NUMBER(38,0) COLUMN Y Y N
2 O_CUSTKEY NUMBER(38,0) COLUMN Y N N
3 O_ORDERSTATUS VARCHAR(4) COLUMN Y N N
4 O_TOTALPRICE NUMBER(15,2) COLUMN Y N N
5 O_ORDERDATE DATE COLUMN Y N N
6 O_ORDERPRIORITY VARCHAR(60) COLUMN Y N N

Default and check are null for every column.

We also inspect a few existing records to establish the baseline:

PostgreSQL
1SELECT
2 o_orderkey,
3 o_custkey,
4 o_totalprice
5FROM tpch1g.orders
6ORDER BY o_orderkey
7LIMIT 5;
Baseline order totals in PostgreSQL, with two decimal places.
Baseline order totals in PostgreSQL, with two decimal places.
Text version

PostgreSQL (DbVisualizer): first 5 orders before the change: 5 rows (0.284 sec)

SELECT o_orderkey, o_custkey, o_totalprice
FROM tpch1g.orders
ORDER BY o_orderkey
LIMIT 5;
o_orderkey o_custkey o_totalprice
1 36901 173665.47
2 78002 46929.18
3 123314 193846.25
4 136777 32151.78
5 44485 144659.20

The same orders in Snowflake:

The same baseline orders in Snowflake, with matching two-decimal totals.
The same baseline orders in Snowflake, with matching two-decimal totals.
Text version

Snowflake: first 5 orders before the change: 5 rows (669 ms)

SELECT O_ORDERKEY, O_CUSTKEY, O_TOTALPRICE
FROM SOLUTIONS_ENGINEERING_POC.TPCHV2__TPCH1G.ORDERS
ORDER BY O_ORDERKEY
LIMIT 5;
O_ORDERKEY O_CUSTKEY O_TOTALPRICE
1 36901 173665.47
2 78002 46929.18
3 123314 193846.25
4 136777 32151.78
5 44485 144659.20

The values match PostgreSQL exactly.

Step 2: Widen the Source Column

We now increase the precision and scale of o_totalprice from NUMERIC(15,2) to NUMERIC(18,4).

PostgreSQL
1ALTER TABLE tpch1g.orders
2ALTER COLUMN o_totalprice TYPE NUMERIC(18,4);

Verify the updated definition:

PostgreSQL
1SELECT
2 column_name,
3 data_type,
4 numeric_precision,
5 numeric_scale
6FROM information_schema.columns
7WHERE table_schema = 'tpch1g'
8 AND table_name = 'orders'
9 AND column_name = 'o_totalprice';
After the ALTER: o_totalprice is now NUMERIC with precision 18 and scale 4.
After the ALTER: o_totalprice is now NUMERIC with precision 18 and scale 4.
Text version

PostgreSQL (DbVisualizer): column definition of tpch1g.orders.o_totalprice after the ALTER: 1 row (0.284 sec)

column_name data_type numeric_precision numeric_scale
o_totalprice numeric 18 4

The column is now NUMERIC(18,4) (previously NUMERIC(15,2)).

Step 3: Update an Existing Record

To validate that the additional precision is retained, we update an existing order with a value containing four decimal places.

PostgreSQL
1UPDATE tpch1g.orders
2SET o_totalprice = o_totalprice + 0.0001
3WHERE o_orderkey = 1;

Verify the updated record:

PostgreSQL
1SELECT
2 o_orderkey,
3 o_custkey,
4 o_totalprice
5FROM tpch1g.orders
6WHERE o_orderkey = 1;

The order total changes from 173665.47 to 173665.4701.

Order 1 in PostgreSQL after the update, now with four decimal places: 173665.4701.
Order 1 in PostgreSQL after the update, now with four decimal places: 173665.4701.
Text version

PostgreSQL (DbVisualizer): updating order 1 and verifying it

UPDATE tpch1g.orders
SET o_totalprice = o_totalprice + 0.0001
WHERE o_orderkey = 1;

SELECT o_orderkey, o_custkey, o_totalprice
FROM tpch1g.orders
WHERE o_orderkey = 1;

Result: 1 row (0.291 sec)

o_orderkey o_custkey o_totalprice
1 36901 173665.4701

Previously 173665.47.

Step 4: Let Hevo Handle the Schema Change

With the source column updated, Hevo detects the data type change and handles the corresponding destination-side schema evolution.

In this example, there is an additional consideration: Snowflake does not support directly increasing the scale of an existing numeric column through a standard ALTER COLUMN operation.

Hevo handles this using its higher decimal scale mechanism. It creates a temporary wider decimal column, copies the existing values, replaces the original column, and retains the original column name.

Once the next scheduled sync completes, the updated schema and data are available in the destination without requiring us to manually recreate or modify the Snowflake column.

Step 5: Verify the Updated Schema and Data in Snowflake

We first inspect the destination table:

Snowflake
1DESC TABLE YOUR_DATABASE.YOUR_SCHEMA.ORDERS;
After the sync: O_TOTALPRICE is NUMBER(18,4) in Snowflake, now the last column of ORDERS.
After the sync: O_TOTALPRICE is NUMBER(18,4) in Snowflake, now the last column of ORDERS.
Text version

Snowflake: DESC TABLE SOLUTIONS_ENGINEERING_POC.TPCHV2__TPCH1G.ORDERS; after the sync: 14 rows (48 ms); rows 9–14 are visible

# name type kind null? primary key unique key
9 __HEVO__INGESTED_AT NUMBER(38,0) COLUMN Y N N
10 __HEVO__OP_TYPE VARCHAR(4) COLUMN Y N N
11 __HEVO__SOURCE_MODIFIED_AT NUMBER(38,0) COLUMN Y N N
12 __HEVO__MARKED_DELETED BOOLEAN COLUMN Y N N
13 __HEVO__LOADED_AT NUMBER(38,0) COLUMN Y N N
14 O_TOTALPRICE NUMBER(18,4) COLUMN Y N N

O_TOTALPRICE is now NUMBER(18,4) (previously NUMBER(15,2) at position 4). It now appears as the last column, consistent with Hevo replacing the original column with a wider one under the same name.

Then verify the updated order:

Snowflake
1SELECT
2 O_ORDERKEY,
3 O_CUSTKEY,
4 O_TOTALPRICE
5FROM YOUR_DATABASE.YOUR_SCHEMA.ORDERS
6WHERE O_ORDERKEY = 1;
Order 1 in Snowflake carries the four-decimal value 173665.4701.
Order 1 in Snowflake carries the four-decimal value 173665.4701.
Text version

Snowflake: verifying order 1 after the sync: 1 row (257 ms)

SELECT O_ORDERKEY, O_CUSTKEY, O_TOTALPRICE
FROM SOLUTIONS_ENGINEERING_POC.TPCHV2__TPCH1G.ORDERS
WHERE O_ORDERKEY = 1;
O_ORDERKEY O_CUSTKEY O_TOTALPRICE
1 36901 173665.4701

Matches the updated PostgreSQL value.

Finally, check a few existing records to confirm that the data remains available:

Snowflake
1SELECT
2 O_ORDERKEY,
3 O_TOTALPRICE
4FROM YOUR_DATABASE.YOUR_SCHEMA.ORDERS
5ORDER BY O_ORDERKEY
6LIMIT 5;

The destination now accommodates the increased decimal precision, and the updated order value is available with all four decimal places.

Existing orders in Snowflake keep their values, now stored with four decimal places.
Existing orders in Snowflake keep their values, now stored with four decimal places.
Text version

Snowflake: first 5 orders after the sync: 5 rows (389 ms)

SELECT O_ORDERKEY, O_TOTALPRICE
FROM SOLUTIONS_ENGINEERING_POC.TPCHV2__TPCH1G.ORDERS
ORDER BY O_ORDERKEY
LIMIT 5;
O_ORDERKEY O_TOTALPRICE
1 173665.4701
2 46929.1800
3 193846.2500
4 32151.7800
5 144659.2000

Order 1 shows the updated value. Orders 2–5 keep their original values, now displayed at scale 4 (for example 46929.18 → 46929.1800). No data was lost.

Conclusion

Column definitions don't always remain static. As applications evolve, columns may need to accommodate larger values, different data types, or greater precision.

Hevo helps manage these changes by detecting supported source-side data type changes and handling the corresponding destination schema evolution. This reduces the need for manual destination modifications and allows existing pipelines to keep up with changing data requirements.

Nitin Bindal
Software Development Engineer - III
schema evolutionpostgresqlsnowflakedata types