{"record":{"id":"74f209568860451f","repo":"apache/seatunnel","slug":"not-supported-create-new-offset-by-timestamp-74f209","errorCode":null,"errorMessage":"not supported create new Offset by timestamp.","messagePattern":"not supported create new Offset by timestamp\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/offset/LsnOffsetFactory.java","lineNumber":153,"sourceCode":"                SourceInfo.TIMESTAMP_USEC_KEY,\n                String.valueOf(Conversions.toEpochMicros(Instant.MIN)));\n        return LsnOffset.of(offsetMap);\n    }\n\n    @Override\n    public Offset specific(Map<String, String> offset) {\n        return new LsnOffset(offset);\n    }\n\n    @Override\n    public Offset specific(String filename, Long position) {\n        throw new UnsupportedOperationException(\n                \"not supported create new Offset by filename and position.\");\n    }\n\n    @Override\n    public Offset timestamp(long timestamp) {\n        throw new UnsupportedOperationException(\"not supported create new Offset by timestamp.\");\n    }\n}\n","sourceCodeStart":135,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/offset/LsnOffsetFactory.java#L135-L156","documentation":"LsnOffsetFactory cannot translate an arbitrary timestamp into a PostgreSQL LSN offset, so timestamp(long) always throws UnsupportedOperationException. LSN offsets are derived from the current WAL position, not from wall-clock time.","triggerScenarios":"Calling `offsetFactory.timestamp(millis)` directly, or a framework feature (e.g. start-from-timestamp) that relies on timestamp-to-offset mapping against a PostgreSQL CDC source.","commonSituations":"Configuring a job to 'start from a given time'; porting MySQL CDC start-timestamp logic to PostgreSQL; generic tooling that builds offsets from timestamps.","solutions":["Start from `latest()` or a previously saved LSN offset (specific(Map)) instead of a timestamp.","To approximate a time-based start, find the corresponding LSN externally (e.g. pg_waldump or pg_current_wal_lsn near the time) and supply it via specific(Map).","If timestamp start is a hard requirement, use a connector/engine version that supports it or snapshot + replay from an earlier saved checkpoint."],"exampleFix":"// before\nOffset o = factory.timestamp(1700000000000L);\n// after\nMap<String,String> offsetMap = new HashMap<>();\noffsetMap.put(\"lsn\", savedLsn);\nOffset o = factory.specific(offsetMap);","handlingStrategy":"type-guard","validationCode":"if (startMode == TIMESTAMP) { throw new IllegalArgumentException(\"PostgreSQL CDC does not support start-from-timestamp\"); }","typeGuard":null,"tryCatchPattern":"try {\n    factory.timestamp(ts);\n} catch (UnsupportedOperationException e) {\n    // use latest() or a saved LSN offset instead\n}","preventionTips":["Avoid timestamp-based start modes for PostgreSQL CDC","Persist LSN offsets at known times if you need approximate time-based restarts","Document supported initial-offset modes for your jobs"],"tags":["postgresql","cdc","offset","unsupported-operation","timestamp"],"backgroundTag":"unsupported-operation","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"}