{"record":{"id":"024c2d4b9581605f","repo":"prestodb/presto","slug":"updatetimestamp","errorCode":null,"errorMessage":"updateTimestamp","messagePattern":"updateTimestamp","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":865,"sourceCode":"    @Override\n    public void updateDate(int columnIndex, Date x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateDate\");\n    }\n\n    @Override\n    public void updateTime(int columnIndex, Time x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTime\");\n    }\n\n    @Override\n    public void updateTimestamp(int columnIndex, Timestamp x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTimestamp\");\n    }\n\n    @Override\n    public void updateAsciiStream(int columnIndex, InputStream x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateAsciiStream\");\n    }\n\n    @Override\n    public void updateBinaryStream(int columnIndex, InputStream x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBinaryStream\");\n    }\n\n    @Override\n    public void updateCharacterStream(int columnIndex, Reader x, int length)","sourceCodeStart":847,"sourceCodeEnd":883,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L847-L883","documentation":"PrestoResultSet.updateTimestamp(int, java.sql.Timestamp) unconditionally throws SQLFeatureNotSupportedException(\"updateTimestamp\"). Presto result sets are read-only; this method exists only to complete the java.sql.ResultSet interface and rejects the call immediately. TIMESTAMP columns cannot be updated through the cursor.","triggerScenarios":"Calling updateTimestamp(columnIndex, ts) or updateTimestamp(columnLabel, ts) on a PrestoResultSet, typically before updateRow(), when trying to set a TIMESTAMP/TIMESTAMP WITH TIME ZONE column in a fetched row.","commonSituations":"Porting audit-timestamp-stamping code from traditional RDBMS drivers; touch-style jobs that update modified_at per row via the cursor; ORMs with updatable result sets enabled against Presto.","solutions":["Issue a parameterized UPDATE (setTimestamp) to change the timestamp column.","For touch patterns, use a single statement like UPDATE t SET modified_at = now() WHERE id IN (...).","Use CONCUR_READ_ONLY result sets and avoid cursor-update code paths.","Configure the data-access layer to treat Presto as read-only."],"exampleFix":"// before\nrs.updateTimestamp(\"modified_at\", now);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET modified_at = current_timestamp WHERE id = ?\")) {\n    ps.setLong(1, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {\n    // Presto: stamp timestamps with UPDATE ... SET modified_at = current_timestamp\n}","typeGuard":"boolean supportsInRowUpdate(ResultSet rs) {\n    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet);\n}","tryCatchPattern":"try {\n    rs.updateTimestamp(\"modified_at\", now);\n    rs.updateRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // run UPDATE t SET modified_at = current_timestamp WHERE id = ?\n}","preventionTips":["Let the database set audit timestamps via DEFAULT/trigger-style SQL expressions in UPDATE statements.","Use CONCUR_READ_ONLY when creating Presto statements.","Disable ORM features that rely on updatable result sets for Presto datasources.","Add integration tests that fail fast if cursor-update paths execute against Presto."],"tags":["jdbc","sqlfeaturenotsupportedexception","read-only-resultset","presto"],"backgroundTag":"jdbc-updatable-resultset-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}