Skip to main content

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 typeDestination typeNotes
SMALLINT / INT2SMALLINT or widerCan widen to INTEGER, BIGINT, or NUMERIC
INTEGER / INT / INT4INTEGER or widerCan widen to BIGINT or NUMERIC
BIGINT / INT8BIGINTNo further integer widening needed
REAL / FLOAT4REAL or widerCan widen to DOUBLE PRECISION
DOUBLE PRECISION / FLOAT8DOUBLE PRECISION
NUMERIC / DECIMALNUMERICPrecision and scale preserved
MONEYTEXTMoney type is not portable across locales; land as TEXT and re-cast if needed
SERIAL / BIGSERIALINTEGER / BIGINTSequence stripped; destination should use its own identity or sequence

Example: numeric transform

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 typeDestination typeNotes
CHAR(n)TEXTTrailing spaces are trimmed by PostgreSQL on extraction
CHARACTER(n)TEXTSame as CHAR
VARCHAR(n)TEXTLength constraint dropped on destination
CHARACTER VARYING(n)TEXTSame as VARCHAR
TEXTTEXTPasses through unchanged
"CHAR" (internal)TEXTSingle-byte internal type
NAMETEXTSystem identifier type
BPCHARTEXTBlank-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 typeDestination typeNotes
DATEDATE
TIMETIME
TIME WITH TIME ZONE / TIMETZTIMETZ
TIMESTAMPTIMESTAMPNo timezone offset
TIMESTAMP WITH TIME ZONE / TIMESTAMPTZTIMESTAMPTZUTC-normalised on storage
INTERVALTEXTINTERVAL is not universally portable; land as TEXT and re-cast at the destination

Example: datetime transform

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 typeDestination typeNotes
BOOLEAN / BOOLBOOLEAN
OIDOID or BIGINTWiden to BIGINT for portability across providers
XIDTEXTTransaction ID; land as TEXT

Binary types

Source typeDestination typeNotes
BYTEABYTEABinary 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 typeDestination typeNotes
INETTEXTIP address with optional prefix
CIDRTEXTNetwork address block
MACADDRTEXTMAC address
MACADDR8TEXTEUI-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 typeDestination typeNotes
JSONJSON or JSONB
JSONBJSONBBinary 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 typeDestination typeNotes
UUIDUUIDRFC 4122 format preserved end-to-end

XML

Source typeDestination typeNotes
XMLTEXTNot all destination providers have a native XML type; TEXT is the safe landing target

Bit string types

Source typeDestination typeNotes
BIT(n)TEXTFixed-length bit string
BIT VARYING(n) / VARBITTEXTVariable-length bit string

Array types

PostgreSQL arrays are serialised to JSON during extraction and stored as JSONB or TEXT in the destination.
Source typeDestination typeExample
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 typeDestination typeExample text value
POINTTEXT(1,2)
LINETEXT{A,B,C}
LSEGTEXT[(0,0),(1,1)]
BOXTEXT(1,1),(0,0)
PATHTEXT[(0,0),(1,0),(1,1)]
POLYGONTEXT((0,0),(1,0),(0.5,1))
CIRCLETEXT<(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 typeDestination typeNotes
TSVECTORTEXTFull-text search document vector
TSQUERYTEXTFull-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

SourceSafe 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

SourceSafe destination types
REAL (FLOAT4)DOUBLE PRECISION, NUMERIC, TEXT
DOUBLE PRECISION (FLOAT8)NUMERIC, TEXT

Character widenings

SourceSafe destination types
CHAR(n)VARCHAR(m) where m ≥ n, TEXT
VARCHAR(n)VARCHAR(m) where m ≥ n, TEXT
TEXTTEXT (already widest)

Temporal widenings

SourceSafe destination types
DATETIMESTAMP, TIMESTAMPTZ, TEXT
TIMETIMETZ, TEXT
TIMESTAMPTIMESTAMPTZ, TEXT

Other widenings

SourceSafe destination types
BOOLEANTEXT ('true' / 'false')
INET / CIDR / MACADDRTEXT
JSONJSONB, TEXT
UUIDTEXT
Any typeTEXT — always a safe last resort

Cross-type widening transform example

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

CategoryTypesDestination landing
NumericSMALLINT, INTEGER, BIGINT, REAL, DOUBLE PRECISION, NUMERIC, DECIMAL, MONEYNative (MONEY → TEXT)
CharacterCHAR, VARCHAR, TEXT, BPCHAR, NAMENative or TEXT
DatetimeDATE, TIME, TIMETZ, TIMESTAMP, TIMESTAMPTZ, INTERVALNative (INTERVAL → TEXT)
BooleanBOOLEANNative
SpecialOID, XIDOID native, XID → TEXT
BinaryBYTEANative
NetworkINET, CIDR, MACADDR, MACADDR8TEXT
JSONJSON, JSONBNative
UUIDUUIDNative
XMLXMLTEXT
Bit stringBIT, VARBITTEXT
Arrayany[]JSONB
GeometricPOINT, LINE, LSEG, BOX, PATH, POLYGON, CIRCLETEXT
RangeINT4RANGE, INT8RANGE, NUMRANGE, TSRANGE, TSTZRANGE, DATERANGETEXT (explicit cast required)
Text searchTSVECTOR, TSQUERYTEXT
Compositeuser-defined compositeTEXT
Enumuser-defined ENUMTEXT