---
title: Handling Column Widening and Data Type Changes with Hevo
description: See how Hevo carries a PostgreSQL NUMERIC(15,2) to NUMERIC(18,4) change into Snowflake automatically, keeping existing data and four-decimal values.
canonical_url: https://hevodata.com/hevo-engineering/handling-column-widening-and-data-type-changes-with-hevo/
image: https://res.cloudinary.com/hevo/image/upload/v1796316865/hevo-website/etl-tools/ipfyy2w5nqtsdkwkowfa.png
published_at: 2026-12-03T16:52:52.360342+00:00
updated_at: 2026-12-03T20:09:43.744411+00:00
author: Nitin Bindal
tags: [schema evolution, postgresql, snowflake, data types]
category: Schema Evolution
content_type: article
word_count: 1029
source: https://hevodata.com/hevo-engineering/handling-column-widening-and-data-type-changes-with-hevo.md
---
# Handling Column Widening and Data Type Changes with Hevo

> See how Hevo carries a PostgreSQL NUMERIC(15,2) to NUMERIC(18,4) change into Snowflake automatically, keeping existing data and four-decimal values.

## 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](https://hevodata.com/) 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](https://www.youtube.com/watch?v=ht2Iu4lhFpk)

_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`**

```sql
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';
```

The column currently uses `NUMERIC(15,2)`.

![Before the change: o_totalprice is NUMERIC with precision 15 and scale 2 in PostgreSQL.](https://res.cloudinary.com/hevo/image/upload/v1796316785/hevo-website/etl-tools/w0k6pekyptxsqkwtre9n.png)

_Text version of the image above:_

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

```sql
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`**

```sql
DESC 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.](https://res.cloudinary.com/hevo/image/upload/v1796316787/hevo-website/etl-tools/rmj6zp6dlpcbyaanao6h.png)

_Text version of the image above:_

**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`**

```sql
SELECT
    o_orderkey,
    o_custkey,
    o_totalprice
FROM tpch1g.orders
ORDER BY o_orderkey
LIMIT 5;
```

![Baseline order totals in PostgreSQL, with two decimal places.](https://res.cloudinary.com/hevo/image/upload/v1796316791/hevo-website/etl-tools/v782tjkx76pf6tk4oaop.png)

_Text version of the image above:_

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

```sql
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.](https://res.cloudinary.com/hevo/image/upload/v1796316789/hevo-website/etl-tools/jseprvb0rv0zfqbu389t.png)

_Text version of the image above:_

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

```sql
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`**

```sql
ALTER TABLE tpch1g.orders
ALTER COLUMN o_totalprice TYPE NUMERIC(18,4);
```

Verify the updated definition:

**`PostgreSQL`**

```sql
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';
```

![After the ALTER: o_totalprice is now NUMERIC with precision 18 and scale 4.](https://res.cloudinary.com/hevo/image/upload/v1796316794/hevo-website/etl-tools/iw3padp2utiimt5rknqv.png)

_Text version of the image above:_

**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`**

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

Verify the updated record:

**`PostgreSQL`**

```sql
SELECT
    o_orderkey,
    o_custkey,
    o_totalprice
FROM tpch1g.orders
WHERE 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.](https://res.cloudinary.com/hevo/image/upload/v1796316795/hevo-website/etl-tools/wo98j5n2ntdp8safekwl.png)

_Text version of the image above:_

**PostgreSQL (DbVisualizer): updating order 1 and verifying it**

```sql
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`**

```sql
DESC TABLE YOUR_DATABASE.YOUR_SCHEMA.ORDERS;
```

![After the sync: O_TOTALPRICE is NUMBER(18,4) in Snowflake, now the last column of ORDERS.](https://res.cloudinary.com/hevo/image/upload/v1796316797/hevo-website/etl-tools/lmz9ugngt2dre1cd6u1o.png)

_Text version of the image above:_

**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`**

```sql
SELECT
    O_ORDERKEY,
    O_CUSTKEY,
    O_TOTALPRICE
FROM YOUR_DATABASE.YOUR_SCHEMA.ORDERS
WHERE O_ORDERKEY = 1;
```

![Order 1 in Snowflake carries the four-decimal value 173665.4701.](https://res.cloudinary.com/hevo/image/upload/v1796316799/hevo-website/etl-tools/wchskpntvrlmif8ownol.png)

_Text version of the image above:_

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

```sql
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`**

```sql
SELECT
    O_ORDERKEY,
    O_TOTALPRICE
FROM YOUR_DATABASE.YOUR_SCHEMA.ORDERS
ORDER BY O_ORDERKEY
LIMIT 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.](https://res.cloudinary.com/hevo/image/upload/v1796316801/hevo-website/etl-tools/zoig8smjjldkffjefgkz.png)

_Text version of the image above:_

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

```sql
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.
