> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Data type changes for Redshift in ELT & CDC

> If the data type mapping differs on the Redshift side, the following section explains how these changes will be handled by the automatic replication feature.

If the data type mapping differs on the Redshift side, the following section explains how these changes will be handled by the automatic replication feature.

| Original Data Type          | Updated Data Type            | Data Type Conversion         | Widening / Narrowing | Column properties adjusted | Backfill supported |
| :-------------------------- | :--------------------------- | :--------------------------- | :------------------- | :------------------------- | :----------------- |
| BIGINT                      | INTEGER                      | BIGINT                       | Narrowing            | ❌                          | N/A                |
|                             | SMALLINT                     | BIGINT                       | Narrowing            | ❌                          | N/A                |
|                             | NUMERIC                      | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | DOUBLE\_PRECISION            | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | REAL                         | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| INTEGER                     | BIGINT                       | BIGINT                       | Widening             | ❌                          | ✅                  |
|                             | SMALLINT                     | INTEGER                      | Narrowing            | ❌                          | N/A                |
|                             | NUMERIC                      | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | DOUBLE\_PRECISION            | DOUBLE\_PRECISION            | Widening             | ❌                          | ✅                  |
|                             | REAL                         | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| SMALLINT                    | BIGINT                       | BIGINT                       | Widening             | ❌                          | ✅                  |
|                             | INTEGER                      | INTEGER                      | Widening             | ❌                          | ✅                  |
|                             | NUMERIC                      | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | DOUBLE\_PRECISION            | DOUBLE\_PRECISION            | Widening             | ❌                          | ✅                  |
|                             | REAL                         | REAL                         | Widening             | ❌                          | ✅                  |
|                             | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| NUMERIC                     | BIGINT                       | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | INTEGER                      | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | SMALLINT                     | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | NUMERIC                      | NUMERIC                      | -                    | ✅                          | N/A                |
|                             | DOUBLE\_PRECISION            | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | REAL                         | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| DOUBLE\_PRECISION           | BIGINT                       | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | INTEGER                      | DOUBLE\_PRECISION            | Narrowing            | ❌                          | N/A                |
|                             | SMALLINT                     | DOUBLE\_PRECISION            | Narrowing            | ❌                          | N/A                |
|                             | NUMERIC                      | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | REAL                         | DOUBLE\_PRECISION            | Narrowing            | ❌                          | N/A                |
|                             | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| REAL                        | BIGINT                       | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | INTEGER                      | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | SMALLINT                     | REAL                         | Narrowing            | ❌                          | N/A                |
|                             | NUMERIC                      | NUMERIC                      | Widening             | ✅                          | ✅                  |
|                             | DOUBLE\_PRECISION            | DOUBLE\_PRECISION            | Narrowing            | ❌                          | N/A                |
|                             | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| VARCHAR                     | VARCHAR                      | VARCHAR                      | -                    | ✅                          | N/A                |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| DATE                        | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | TIMESTAMP\_WITH\_TIMEZONE    | TIMESTAMP\_WITH\_TIMEZONE    | Widening             | ❌                          | ✅                  |
|                             | TIMESTAMP\_WITHOUT\_TIMEZONE | TIMESTAMP\_WITHOUT\_TIMEZONE | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| TIMESTAMP\_WITH\_TIMEZONE   | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | DATE                         | TIMESTAMP\_WITH\_TIMEZONE    | Narrowing            | ❌                          | N/A                |
|                             | TIMESTAMP\_WITHOUT TIMEZONE  | TIMESTAMP\_WITH\_TIMEZONE    | Narrowing            | ❌                          | N/A                |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| TIMESTAMP\_WITHOUT TIMEZONE | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | DATE                         | TIMESTAMP\_WITHOUT TIMEZONE  | Narrowing            | ❌                          | N/A                |
|                             | TIMESTAMP\_WITH TIMEZONE     | TIMESTAMP\_WITH TIMEZONE     | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |
| TIME\_WITH TIMEZONE         | VARCHAR                      | VARCHAR                      | Widening             | ❌                          | ✅                  |
|                             | Others                       | Same as Updated Data Type    | -                    | ❌                          | ❌                  |

## Important Notes

* **Narrowing Changes:** The pipeline will ignore narrowing changes to ensure compatibility between old and new data in the destination.
* **Numeric Field Adjustments:** In some cases, the pipeline will change the data type of a numeric field to `NUMERIC` to accommodate both old and new data in the destination.
* **Handling Precision and Scale Limits:** With numeric data types, the pipeline will attempt to fit both old and new data into the destination. However, due to constraints on the destination's maximum precision and scale, this may not always be possible. If the data cannot be accommodated, an error will be thrown, prompting a re-sync.
* **Backfilling:** Backfilling a column involves copying existing data from the old column to a new column with the updated data type, ensuring that no data is lost during the conversion.
