John Shott <shott@stanford.edu> writes:
> update status set some_column = 'some_value' where oid = 'some_string'
> org.postgresql.util.PSQLException: ERROR: operator does not exist: oid =
> character varying
> Because these SQL commands are generated on the fly by a Java
> application that opens a JDBC connection to our database, we would
> rather not use explicit casting and would prefer to add appropriate
> casts in our Postgresql 8.4 databases to match the behavior that we get
> in Postgresql 7.4/8.0/8.1/8.2/8.3 databases.
I can assure you that that didn't work in 8.3 either.
You really need to fix your app to not be forcing these strings to
varchar. Even in old versions, that code worked for only very small
values of "work": it would have used textual rather than numeric
comparison, which isn't really the semantics you want and would have
had a huge performance cost (notably, the inability to use an index
on the oid column).
What you probably need to be doing is not using setString() to set the
parameter values, but you could get better advice about that on the
pgsql-jdbc list.
regards, tom lane