{"record":{"id":"f028171a8558c6cc","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-f02817","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which exceeds the maximum precision of {}, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which exceeds the maximum precision of (.+?), it will be converted to decimal\\((.+?),(.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresTypeConverter.java","lineNumber":357,"sourceCode":"                    DecimalType decimalType = (DecimalType) column.getDataType();\n                    long precision = decimalType.getPrecision();\n                    int scale = decimalType.getScale();\n                    if (precision <= 0) {\n                        precision = DEFAULT_PRECISION;\n                        scale = DEFAULT_SCALE;\n                        log.warn(\n                                \"The decimal column {} type decimal({},{}) is out of range, \"\n                                        + \"which is precision less than 0, \"\n                                        + \"it will be converted to decimal({},{})\",\n                                column.getName(),\n                                decimalType.getPrecision(),\n                                decimalType.getScale(),\n                                precision,\n                                scale);\n                    } else if (precision > MAX_PRECISION) {\n                        scale = (int) Math.max(0, scale - (precision - MAX_PRECISION));\n                        precision = MAX_PRECISION;\n                        log.warn(\n                                \"The decimal column {} type decimal({},{}) is out of range, \"\n                                        + \"which exceeds the maximum precision of {}, \"\n                                        + \"it will be converted to decimal({},{})\",\n                                column.getName(),\n                                decimalType.getPrecision(),\n                                decimalType.getScale(),\n                                MAX_PRECISION,\n                                precision,\n                                scale);\n                    }\n                    if (scale < 0) {\n                        scale = 0;\n                        log.warn(\n                                \"The decimal column {} type decimal({},{}) is out of range, \"\n                                        + \"which is scale less than 0, \"\n                                        + \"it will be converted to decimal({},{})\",\n                                column.getName(),\n                                decimalType.getPrecision(),","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresTypeConverter.java#L339-L375","documentation":"This warning is logged by PostgresTypeConverter.reconvert when a DECIMAL column's precision exceeds Postgres' maximum precision (38). The converter automatically downgrades the precision (and reduces scale by the same amount) instead of failing the job. It indicates the catalog type will not round-trip exactly.","triggerScenarios":"Sink writes to Postgres a column declared DECIMAL(p,s) with p > 38 (MAX_PRECISION); reconvert() runs during catalog-to-Postgres type mapping.","commonSituations":"Copying tables from engines allowing huge precision (e.g. Hive/Oracle NUMBER, MySQL DECIMAL(65,x), Spark DECIMAL(38+)) into Postgres.","solutions":["Reduce source column precision to <= 38 before syncing","Explicitly set a supported decimal(p,s) type in the sink schema","Accept the automatic truncation if losing fractional digits is acceptable"],"exampleFix":"// before: catalog column DECIMAL(65,30)\n// after: use DECIMAL(38,15) or cast in source query CAST(col AS DECIMAL(38,15))","handlingStrategy":"validation","validationCode":"if (decimalType.getPrecision() > 38) { /* cast source column: CAST(col AS DECIMAL(38, s')) */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check source decimal precision against the target dialect's max before creating jobs","Use CAST in the source query to normalize decimal types"],"tags":["jdbc","postgres","decimal","type-conversion"],"backgroundTag":"value-out-of-range","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}