prestodb/presto · error · SQLFeatureNotSupportedException
updateTimestamp
Error message
updateTimestamp
What it means
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.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:865
@Override
public void updateDate(int columnIndex, Date x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateDate");
}
@Override
public void updateTime(int columnIndex, Time x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateTime");
}
@Override
public void updateTimestamp(int columnIndex, Timestamp x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateTimestamp");
}
@Override
public void updateAsciiStream(int columnIndex, InputStream x, int length)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateAsciiStream");
}
@Override
public void updateBinaryStream(int columnIndex, InputStream x, int length)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateBinaryStream");
}
@Override
public void updateCharacterStream(int columnIndex, Reader x, int length)View on GitHub (pinned to 55bb57d202)
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.
Example fix
// before
rs.updateTimestamp("modified_at", now);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET modified_at = current_timestamp WHERE id = ?")) {
ps.setLong(1, id);
ps.executeUpdate();
} Defensive patterns
Strategy: try-catch
Validate before calling
if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {
// Presto: stamp timestamps with UPDATE ... SET modified_at = current_timestamp
} Type guard
boolean supportsInRowUpdate(ResultSet rs) {
return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet);
} Try / catch
try {
rs.updateTimestamp("modified_at", now);
rs.updateRow();
} catch (SQLFeatureNotSupportedException e) {
// run UPDATE t SET modified_at = current_timestamp WHERE id = ?
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/024c2d4b9581605f.
Report an issue: GitHub.