apache/seatunnel · warning
The timestamp column {} type timestamp({}) is out of range,
Error message
The timestamp column {} type timestamp({}) is out of range, which exceeds the maximum scale of {}, it will be converted to timestamp({}) What it means
WARN logged by PostgresTypeConverter.reconvert when a timestamp column's requested scale exceeds the PostgreSQL maximum; the scale is capped at MAX_SCALE and the reduced timestamp(scale) is emitted in the DDL. Type-adjustment warning only.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresTypeConverter.java:445
+ "it will be converted to time({})",
column.getName(),
column.getScale(),
MAX_SCALE,
timeScale);
}
if (timeScale != null && timeScale > 0) {
builder.columnType(String.format("%s(%s)", PG_TIME, timeScale));
} else {
builder.columnType(PG_TIME);
}
builder.dataType(PG_TIME);
builder.scale(timeScale);
break;
case TIMESTAMP:
Integer timestampScale = column.getScale();
if (timestampScale != null && timestampScale > MAX_TIMESTAMP_SCALE) {
timestampScale = MAX_TIMESTAMP_SCALE;
log.warn(
"The timestamp column {} type timestamp({}) is out of range, "
+ "which exceeds the maximum scale of {}, "
+ "it will be converted to timestamp({})",
column.getName(),
column.getScale(),
MAX_TIMESTAMP_SCALE,
timestampScale);
}
if (timestampScale != null && timestampScale > 0) {
builder.columnType(String.format("%s(%s)", PG_TIMESTAMP, timestampScale));
} else {
builder.columnType(PG_TIMESTAMP);
}
builder.dataType(PG_TIMESTAMP);
builder.scale(timestampScale);
break;
case TIMESTAMP_TZ:
Integer timestampTzScale = column.getScale();View on GitHub (pinned to cf67b549a7)
Solutions
- CAST source column to TIMESTAMP(6)
- Declare the sink column with scale <= 6
- Accept truncation of sub-microsecond precision
Example fix
// before: TIMESTAMP(9) // after: CAST(col AS TIMESTAMP(6))
Defensive patterns
Strategy: validation
Validate before calling
if (column.getScale() != null && column.getScale() > 6) { /* CAST source to TIMESTAMP(6) */ } Prevention
- Use TIMESTAMP(6) or less in source pipelines feeding Postgres
- Expect truncation of nanosecond digits and validate data fidelity
When it happens
Trigger: Sink TIMESTAMP column with scale > MAX_TIMESTAMP_SCALE (Postgres supports up to 6 fractional digits).
Common situations: Nanosecond-precision timestamps (9 digits) from engines like Spark/MySQL 8 written to Postgres.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- The timestamp column {} type timestamp({}) is out of range,
- The timestamp column {} type timestamp({}) is out of range,
- The timestamp_tz column {} type datetime_tz({}) is out of ra
- The scale of timestamp type is larger than {}, it will be tr
- The decimal column {} type decimal({},{}) is out of range, w
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/be182b9b45ad8dd8.
Report an issue: GitHub.