I cannot show the correct type in the prepared statement. This code:
String sql = "delete from foo where ctid = ?"; PreparedStatement deleteStmt = conn.prepareStatement( sql ); deleteStmt.setString(1, "(0,43)");
throws this exception:
org.postgresql.util.PSQLException: ERROR: operator does not exist: tid = character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 28
Note that from psql, removal works using the line:
mydb=# DELETE FROM foo where ctid = '(0,43)'; DELETE 1
What is the correct type / encoding for tid in JDBC PreparedStatement? I tried setRowId () (throws ava.sql.SQLFeatureNotSupportedException: method org.postgresql.jdbc4.Jdbc4PreparedStatement.setRowId (int, RowId) is not implemented yet.) And setBytes () (throws ... operator does not exist): tid = b
source share