Documentation Index
Fetch the complete documentation index at: https://docs.mantrixflow.com/llms.txt
Use this file to discover all available pages before exploring further.
MantrixFlow supports all official PostgreSQL data types when reading from a PostgreSQL source. This page documents how each type is handled, what lands in the destination, and which cross-type widenings are safe to use.
Numeric types
Source columns with these types are extracted and loaded natively. No cast is required in the destination unless you are widening.
| Source type | Destination type | Notes |
|---|
SMALLINT / INT2 | SMALLINT or wider | Can widen to INTEGER, BIGINT, or NUMERIC |
INTEGER / INT / INT4 | INTEGER or wider | Can widen to BIGINT or NUMERIC |
BIGINT / INT8 | BIGINT | No further integer widening needed |
REAL / FLOAT4 | REAL or wider | Can widen to DOUBLE PRECISION |
DOUBLE PRECISION / FLOAT8 | DOUBLE PRECISION | |
NUMERIC / DECIMAL | NUMERIC | Precision and scale preserved |
MONEY | TEXT | Money type is not portable across locales; land as TEXT and re-cast if needed |
SERIAL / BIGSERIAL | INTEGER / BIGINT | Sequence stripped; destination should use its own identity or sequence |
SELECT
id,
smallint_col::INTEGER AS int_val,
int_col::BIGINT AS big_val,
numeric_col::NUMERIC(18,4) AS precise_val,
real_col::DOUBLE PRECISION AS float_val,
money_col::TEXT AS money_text
FROM {{ source }}
Character types
| Source type | Destination type | Notes |
|---|
CHAR(n) | TEXT | Trailing spaces are trimmed by PostgreSQL on extraction |
CHARACTER(n) | TEXT | Same as CHAR |
VARCHAR(n) | TEXT | Length constraint dropped on destination |
CHARACTER VARYING(n) | TEXT | Same as VARCHAR |
TEXT | TEXT | Passes through unchanged |
"CHAR" (internal) | TEXT | Single-byte internal type |
NAME | TEXT | System identifier type |
BPCHAR | TEXT | Blank-padded CHAR alias |
CHAR and VARCHAR always widen safely to TEXT. No data is lost. This is the most common cross-type widening in Postgres-to-Postgres pipelines.
Datetime types
| Source type | Destination type | Notes |
|---|
DATE | DATE | |
TIME | TIME | |
TIME WITH TIME ZONE / TIMETZ | TIMETZ | |
TIMESTAMP | TIMESTAMP | No timezone offset |
TIMESTAMP WITH TIME ZONE / TIMESTAMPTZ | TIMESTAMPTZ | UTC-normalised on storage |
INTERVAL | TEXT | INTERVAL is not universally portable; land as TEXT and re-cast at the destination |
SELECT
id,
created_at::DATE AS date_only,
event_ts::TIMESTAMPTZ AS event_utc,
EXTRACT(EPOCH FROM event_ts) AS epoch_seconds,
interval_col::TEXT AS duration_text
FROM {{ source }}
Boolean and special types
| Source type | Destination type | Notes |
|---|
BOOLEAN / BOOL | BOOLEAN | |
OID | OID or BIGINT | Widen to BIGINT for portability across providers |
XID | TEXT | Transaction ID; land as TEXT |
Binary types
| Source type | Destination type | Notes |
|---|
BYTEA | BYTEA | Binary data passed through as-is |
SELECT id, encode(bytea_col, 'hex')::TEXT AS bytea_hex FROM {{ source }}
Network address types
These types are not natively portable to all providers (e.g. RDS restricts some). Land as TEXT for maximum compatibility.
| Source type | Destination type | Notes |
|---|
INET | TEXT | IP address with optional prefix |
CIDR | TEXT | Network address block |
MACADDR | TEXT | MAC address |
MACADDR8 | TEXT | EUI-64 MAC address |
SELECT
id,
inet_col::TEXT AS ip_address,
cidr_col::TEXT AS network,
macaddr_col::TEXT AS mac
FROM {{ source }}
JSON types
| Source type | Destination type | Notes |
|---|
JSON | JSON or JSONB | |
JSONB | JSONB | Binary JSON; preserves key order on extraction |
Flatten JSONB to columns
SELECT
id,
jsonb_col->>'name' AS name,
(jsonb_col->>'price')::NUMERIC AS price,
jsonb_col->'tags' AS tags_jsonb
FROM {{ source }}
UUID
| Source type | Destination type | Notes |
|---|
UUID | UUID | RFC 4122 format preserved end-to-end |
XML
| Source type | Destination type | Notes |
|---|
XML | TEXT | Not all destination providers have a native XML type; TEXT is the safe landing target |
Bit string types
| Source type | Destination type | Notes |
|---|
BIT(n) | TEXT | Fixed-length bit string |
BIT VARYING(n) / VARBIT | TEXT | Variable-length bit string |
Array types
PostgreSQL arrays are serialised to JSON during extraction and stored as JSONB or TEXT in the destination.
| Source type | Destination type | Example |
|---|
INTEGER[] | JSONB | [1, 2, 3] |
TEXT[] | JSONB | ["a", "b"] |
BOOLEAN[] | JSONB | [true, false] |
NUMERIC[] | JSONB | [1.5, 2.5] |
UUID[] | JSONB | ["uuid1", "uuid2"] |
SELECT
id,
int_array_col::TEXT AS int_array_text,
text_array_col::TEXT AS text_array_text
FROM {{ source }}
Geometric types
PostgreSQL geometric types have no standard SQL equivalent. They are landed as TEXT using the default PostgreSQL text representation.
| Source type | Destination type | Example text value |
|---|
POINT | TEXT | (1,2) |
LINE | TEXT | {A,B,C} |
LSEG | TEXT | [(0,0),(1,1)] |
BOX | TEXT | (1,1),(0,0) |
PATH | TEXT | [(0,0),(1,0),(1,1)] |
POLYGON | TEXT | ((0,0),(1,0),(0.5,1)) |
CIRCLE | TEXT | <(0,0),5> |
Range types
PostgreSQL range types (INT4RANGE, INT8RANGE, NUMRANGE, TSRANGE, TSTZRANGE, DATERANGE) are not understood by the dlt extraction layer and land as empty columns unless explicitly cast to TEXT in the transform.
Always cast range columns to TEXT in your SQL transform:
SELECT
id,
int4range_col::TEXT AS int_range,
int8range_col::TEXT AS bigint_range,
numrange_col::TEXT AS num_range,
tsrange_col::TEXT AS ts_range,
tstzrange_col::TEXT AS tstz_range,
daterange_col::TEXT AS date_range
FROM {{ source }}
The destination column type should be TEXT. To re-parse at query time: int4range_col::INT4RANGE.
Text search types
| Source type | Destination type | Notes |
|---|
TSVECTOR | TEXT | Full-text search document vector |
TSQUERY | TEXT | Full-text search query expression |
SELECT
id,
tsvector_col::TEXT AS document_vector,
tsquery_col::TEXT AS search_query
FROM {{ source }}
Composite types
User-defined composite types are not portable across instances. They are cast to TEXT during extraction using the default PostgreSQL text representation.
SELECT
id,
person_col::TEXT AS person_text,
item_col::TEXT AS item_text
FROM {{ source }}
Enum types
PostgreSQL ENUM types are cast to TEXT because enum definitions are instance-specific and cannot be recreated automatically on the destination.
SELECT
id,
mood_col::TEXT AS mood,
status_col::TEXT AS status
FROM {{ source }}
Cross-type widening
Cross-type widening lets the destination use a broader type than the source without losing data. The table below lists all safe widenings that MantrixFlow supports.
Integer widenings
| Source | Safe destination types |
|---|
SMALLINT (INT2) | INTEGER, BIGINT, NUMERIC, REAL, DOUBLE PRECISION, TEXT |
INTEGER (INT4) | BIGINT, NUMERIC, REAL, DOUBLE PRECISION, TEXT |
BIGINT (INT8) | NUMERIC, TEXT |
Float widenings
| Source | Safe destination types |
|---|
REAL (FLOAT4) | DOUBLE PRECISION, NUMERIC, TEXT |
DOUBLE PRECISION (FLOAT8) | NUMERIC, TEXT |
Character widenings
| Source | Safe destination types |
|---|
CHAR(n) | VARCHAR(m) where m ≥ n, TEXT |
VARCHAR(n) | VARCHAR(m) where m ≥ n, TEXT |
TEXT | TEXT (already widest) |
Temporal widenings
| Source | Safe destination types |
|---|
DATE | TIMESTAMP, TIMESTAMPTZ, TEXT |
TIME | TIMETZ, TEXT |
TIMESTAMP | TIMESTAMPTZ, TEXT |
Other widenings
| Source | Safe destination types |
|---|
BOOLEAN | TEXT ('true' / 'false') |
INET / CIDR / MACADDR | TEXT |
JSON | JSONB, TEXT |
UUID | TEXT |
| Any type | TEXT — always a safe last resort |
SELECT
id,
smallint_col::BIGINT AS widened_to_bigint,
int_col::NUMERIC AS widened_to_numeric,
char_col::TEXT AS widened_to_text,
varchar_col::TEXT AS widened_to_text,
real_col::DOUBLE PRECISION AS widened_to_float8,
date_col::TIMESTAMPTZ AS widened_to_tstz,
timestamp_col::TIMESTAMPTZ AS promoted_to_tstz,
bool_col::TEXT AS bool_as_text,
inet_col::TEXT AS inet_text,
json_col::JSONB AS promoted_to_jsonb
FROM {{ source }}
Full type coverage summary
| Category | Types | Destination landing |
|---|
| Numeric | SMALLINT, INTEGER, BIGINT, REAL, DOUBLE PRECISION, NUMERIC, DECIMAL, MONEY | Native (MONEY → TEXT) |
| Character | CHAR, VARCHAR, TEXT, BPCHAR, NAME | Native or TEXT |
| Datetime | DATE, TIME, TIMETZ, TIMESTAMP, TIMESTAMPTZ, INTERVAL | Native (INTERVAL → TEXT) |
| Boolean | BOOLEAN | Native |
| Special | OID, XID | OID native, XID → TEXT |
| Binary | BYTEA | Native |
| Network | INET, CIDR, MACADDR, MACADDR8 | TEXT |
| JSON | JSON, JSONB | Native |
| UUID | UUID | Native |
| XML | XML | TEXT |
| Bit string | BIT, VARBIT | TEXT |
| Array | any[] | JSONB |
| Geometric | POINT, LINE, LSEG, BOX, PATH, POLYGON, CIRCLE | TEXT |
| Range | INT4RANGE, INT8RANGE, NUMRANGE, TSRANGE, TSTZRANGE, DATERANGE | TEXT (explicit cast required) |
| Text search | TSVECTOR, TSQUERY | TEXT |
| Composite | user-defined composite | TEXT |
| Enum | user-defined ENUM | TEXT |