{"record":{"id":"3a404c03e067bbc2","repo":"pentaho/pentaho-kettle","slug":"pgbulkloader-doesn-t-know-how-to-handle-timestamp-neither","errorCode":null,"errorMessage":"PGBulkLoader doesn't know how to handle timestamp (neither passthrough, nor date or datetime for field ","messagePattern":"PGBulkLoader doesn't know how to handle timestamp \\(neither passthrough, nor date or datetime for field ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoader.java","lineNumber":393,"sourceCode":"                //\n                case PGBulkLoaderMeta.NR_DATE_MASK_DATE:\n                  String dateString = data.dateMeta.getString( valueMeta.getDate( valueData ) );\n                  if ( dateString != null ) {\n                    pgCopyOut.write( dateString.getBytes( clientEncoding ) );\n                  }\n                  break;\n\n                // Convert to a \"YYYY-MM-DD HH:MM:SS.mmm\" format\n                //\n                case PGBulkLoaderMeta.NR_DATE_MASK_DATETIME:\n                  String dateTimeString = data.dateTimeMeta.getString( valueMeta.getDate( valueData ) );\n                  if ( dateTimeString != null ) {\n                    pgCopyOut.write( dateTimeString.getBytes( clientEncoding ) );\n                  }\n                  break;\n\n                default:\n                  throw new KettleException( \"PGBulkLoader doesn't know how to handle timestamp (neither passthrough, nor date or datetime for field \" + valueMeta.getName() );\n              }\n              break;\n            case ValueMetaInterface.TYPE_NUMBER:\n              if ( valueMeta.isStorageBinaryString() ) {\n                pgCopyOut.write( (byte[]) valueData );\n              } else {\n                pgCopyOut.write( Double.toString( valueMeta.getNumber( valueData ) ).getBytes( clientEncoding ) );\n              }\n              break;\n            case ValueMetaInterface.TYPE_BIGNUMBER:\n              if ( valueMeta.isStorageBinaryString() ) {\n                pgCopyOut.write( (byte[]) valueData );\n              } else {\n                BigDecimal big = valueMeta.getBigNumber( valueData );\n                if ( big != null ) {\n                  pgCopyOut.write( big.toString().getBytes( clientEncoding ) );\n                }\n              }","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoader.java#L375-L411","documentation":"Same internal switch as the date case but for fields of ValueMetaInterface.TYPE_TIMESTAMP: writeRowToPostgres found a timestamp field whose data.dateFormatChoices[i] is not one of passthrough/date/datetime, so it throws. It means the timestamp field's format choice was never mapped to a supported option.","triggerScenarios":"A TYPE_TIMESTAMP field is processed with an uninitialized or unrecognized dateFormatChoices[i], usually because its date_mask metadata was missing or stored with a value the loader doesn't recognize.","commonSituations":"Transformations exported/imported across Pentaho versions where timestamp masks were serialized differently; timestamp fields added by upstream steps after the mapping was built and never configured; corrupted repository attributes.","solutions":["Set an explicit Date mask (date/datetime/passthrough) for the timestamp field on the step's Fields tab and re-save","Check the stored date_mask for the field in the ktr XML or repository and correct it","Rebuild the field mapping via 'Get Fields' so new timestamp fields get default choices","Initialize defaults in meta code so timestamps always map to a valid choice"],"exampleFix":"// before\n// field added later, dateFormatChoices[i] never set\n// after (in meta.getFields/allocate)\ndata.dateFormatChoices[i] = meta.getFieldDateMaskAsInt( i ); // e.g. pass/date/datetime enum","handlingStrategy":"validation","validationCode":"// same check for timestamp fields\nfor ( int i = 0; i < meta.getFieldStream().length; i++ ) {\n  String mask = meta.getFieldDateMask()[i];\n  if ( mask == null || mask.isEmpty() ) {\n    throw new IllegalStateException( \"Missing date mask for field \" + meta.getFieldStream()[i] );\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"doesn't know how to handle timestamp\" ) ) {\n    // set a valid mask for the named timestamp field and re-run\n  }\n}","preventionTips":["Re-run 'Get Fields' after upstream changes add timestamp fields","Keep masks as recognized constants, never free text","Re-save metadata after Pentaho/plugin upgrades"],"tags":["kettle","postgresql","timestamp","configuration"],"backgroundTag":"invalid-enum-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}