Skip to main content

Data Type Mapping

The table below shows how each upstream PostgreSQL column type maps to a Doris column type. There is a single mapping, shared by both sync methods — the only difference is who creates the target table:

  • Auto Table Creation Sync: Doris reads the upstream schema and creates the target table with these Doris column types automatically.
  • SQL Mapping Sync: you create the target table yourself, using a compatible Doris type for each column.

In both cases, the values are written following the same mapping. For types that are not supported, see Limitations.

PostgreSQL to Doris

PostgreSQL TypeDoris TypeNotes
boolBOOLEAN
bit(1)BOOLEAN
bit(n>1) / varbitSTRING
int2 / smallserialSMALLINT
int4 / serialINT
int8 / bigserialBIGINT
float4FLOAT
float8DOUBLE
numeric(p,s)DECIMAL(min(p,38), s)Precision capped at 38; scale defaults to 9 when unspecified
bpchar(n) (i.e. CHAR(n))CHAR / VARCHARLength scaled ×3 for UTF-8; > 255 becomes VARCHAR
varchar / textSTRINGPostgreSQL varchar maps to STRING (no length)
dateDATE
timestamp / timestamptzDATETIME(s)Scale 0–6; timestamptz normalized to the server time zone
time / timetz / intervalSTRINGtimetz keeps its UTC-normalized offset
uuid / inet / cidr / macaddr / macaddr8STRING
byteaSTRINGBase64-encoded string
xml / hstoreSTRING
json / jsonbJSON
Geometry types (point, line, polygon, …)STRINGSerialized as a GeoJSON string (type / coordinates / srid)
Array types (e.g. int4[], text[])ARRAY<T>One-dimensional only
Other / user-defined typesSTRING