Data type mapping for integrations with Amazon S3 Tables
This is preview documentation for the Aurora PostgreSQL integration with Amazon S3
Tables. Before using this capability, review the Betas and Previews terms in
the AWS Service
Terms
When the Aurora PostgreSQL integration with Amazon S3 Tables replicates a table, each PostgreSQL column type maps to an Apache Iceberg type in the target table.
Topics
Direct type mappings
The following PostgreSQL types map directly to an Iceberg type.
| PostgreSQL type | Iceberg type |
|---|---|
BIGINT |
long |
BOOLEAN |
boolean |
DATE |
date |
DOUBLE PRECISION |
double |
INTEGER |
int |
NAME |
string |
NUMERIC(p, s) |
decimal(p, s) |
REAL |
float |
SMALLINT |
int |
TIME |
string |
TIMETZ |
string |
TIMESTAMP |
timestamp |
TIMESTAMPTZ |
timestamptz |
UUID |
string |
SMALLSERIAL, SERIAL |
int |
BIGSERIAL |
long |
Transformed type mappings
The following types are converted to an Iceberg type that can represent them.
| PostgreSQL type | Iceberg type |
|---|---|
CID, OID, XID |
long |
XID8 |
decimal(20, 0) |
CIDR, INET, MACADDR,
MACADDR8, PG_LSN |
string |
MONEY |
decimal(20, 3) |
INTERVAL |
string |
Text, binary, JSON, and array types
The following table lists the Iceberg types for text, binary, JSON, and array types. JSON values and arrays are stored as JSON text in Iceberg string columns.
| PostgreSQL type | Iceberg type |
|---|---|
TEXT, VARCHAR, CHAR,
BPCHAR |
string |
BYTEA |
binary |
BIT(n) |
binary |
BIT VARYING |
binary |
JSON, JSONB |
string |
JSONPATH, TSQUERY, XML,
PG_SNAPSHOT |
string |
TSVECTOR |
string |
INT2VECTOR |
string |
OIDVECTOR |
string |
Arrays of any supported element type, of any dimension, such as
INTEGER[] or TEXT[] |
string (the array as JSON text, for example
[1,2,3]) |
If a table has an array of an unsupported element type, replication of the table
fails. A NUMERIC array replicates as a string even if its element type has
no precision or scale or exceeds the limits listed in Unsupported types and values. Those limits apply
only to scalar NUMERIC columns. As a primary key column, an array of
JSONB, BIT VARYING, TIMESTAMPTZ,
INT2VECTOR, or OIDVECTOR is not supported.
Generated, default, and identity columns
The integration replicates the values stored in the following columns. The target
column has the Iceberg type that matches the source column's base type, for example
int for a SERIAL column. The target column does not include
the source column's generation expression or default value.
-
Stored generated columns (
GENERATED ALWAYS AS ... STORED). -
Columns with a
DEFAULT. -
Identity columns (
GENERATED ALWAYS AS IDENTITYorGENERATED BY DEFAULT AS IDENTITY). -
SMALLSERIAL,SERIAL, andBIGSERIALcolumns.
If you add a generated, default, identity, or serial column to an existing source table, the integration resyncs the table so that existing rows in the target table get the values that PostgreSQL stored for that column. For more information, see Changes that cause a resync.
A generated column that evaluates to NULL replicates as NULL. An explicit NULL in a
column with a DEFAULT stays NULL and is not replaced by the default.
Unsupported types and values
If a table has a column of one of the following types, the integration does not
replicate the table. Instead, the table enters the FAILED state, its
status_reason is SOURCE_UNSUPPORTED_TYPE, and its
status_detail names the column and its type. For user-defined types,
such as enums, domains, and composite types, status_detail shows the type as
USER-DEFINED. To avoid the failure, exclude the column with a data rule.
The unsupported types are the following:
-
NUMERICwith no precision or scale, with precision greater than 38, with a scale larger than its precision, or with a negative scale. -
Composite types and other user-defined types.
-
HSTORE. -
Range types, such as
INT4RANGEandNUMRANGE, and multirange types, such asINT4MULTIRANGE. -
Geometry and geography types, such as
POINT,LINE,LSEG,BOX,PATH,POLYGON,CIRCLE, and PostGIS types.
To replicate the table, exclude the column with a data rule or change its type at the source, and then resync the table. For more information, see Data rules for integrations with Amazon S3 Tables and Resyncing integrations with Amazon S3 Tables.
If a row holds a value that the integration cannot represent, the table enters the
FAILED state with the reason SOURCE_UNSUPPORTED_VALUE.
This includes the following values of otherwise supported types:
-
NaN, Infinity, and -Infinity in a
NUMERICcolumn. -
infinityand-infinityin aDATE,TIMESTAMP, orTIMESTAMPTZcolumn. -
Dates and timestamps in the BC era, for example
0001-01-01 BC, in aDATE,TIMESTAMP, orTIMESTAMPTZcolumn.
To replicate the table, correct the value at the source, and then resync the table.
NaN, Infinity, and -Infinity in REAL and DOUBLE PRECISION
columns are supported. They replicate as the matching special values of the Iceberg
float and double types.
For a list of all status_reason values and how to resolve each one, see
Per-table status.