Skip to main content

PostgreSQL connector reference

Preview

The PostgreSQL connector for Lakeflow Connect is in Public Preview. Reach out to your Databricks account team to enroll in the Public Preview.

This page contains reference material for the PostgreSQL connector in Databricks Lakeflow Connect.

Automatic data transformations

Databricks automatically transforms the following PostgreSQL data types to Delta-compatible data types:

PostgreSQL type

Delta type

BOOLEAN

BOOLEAN

SMALLINT

SMALLINT

INTEGER

INT

BIGINT

BIGINT

DECIMAL(p,s)

DECIMAL(p,s)

NUMERIC(p,s)

DECIMAL(p,s)

REAL

FLOAT

DOUBLE PRECISION

DOUBLE

SMALLSERIAL

SMALLINT

SERIAL

INT

BIGSERIAL

BIGINT

MONEY

DECIMAL(19,2)

CHAR(n)

STRING

VARCHAR(n)

STRING

TEXT

STRING

BYTEA

BINARY

DATE

DATE

TIME

STRING

TIME WITH TIME ZONE

STRING

TIMESTAMP

TIMESTAMP

TIMESTAMP WITH TIME ZONE

TIMESTAMP

INTERVAL

STRING

UUID

STRING

JSON

STRING

JSONB

STRING

XML

STRING

ARRAY

STRING

CIDR

STRING

INET

STRING

MACADDR

STRING

BIT(n)

BINARY

BIT VARYING(n)

BINARY

Important notes about date and time types

  • DATE columns are ingested as the Delta DATE type.
  • TIMESTAMP and TIMESTAMP WITH TIME ZONE columns are ingested as the Delta TIMESTAMP type. For TIMESTAMP WITH TIME ZONE, the timezone information is preserved during ingestion.
  • TIME, TIME WITH TIME ZONE, and INTERVAL columns are ingested as strings in their original format. You can use Databricks SQL functions to parse these strings into the appropriate time representations if needed.

User-defined and third-party data types

User-defined types and data types from third-party PostgreSQL extensions are ingested as strings. If you need to transform these types, you can use Databricks SQL functions to parse the string representations in downstream processing.

Composite types

PostgreSQL composite types (also known as row types) are ingested as strings. The string representation follows PostgreSQL's composite type format: (value1,value2,value3).