Opened 18 years ago
Closed 18 years ago
#2116 closed defect (fixed)
Database error in postgres
|Reported by:||anonymous||Owned by:||Jonas Borgström|
Trac detected an internal error: ERROR: Unable to identify an operator '=' for types 'text' and 'integer' You will have to retype this query using an explicit cast
This is both in postgres 7.2.1 and 7.4.8 whic are on the old side, but I suspect it'll happen in newer versions too.
It's easily resolved by changing the id field in the attachment table from a test field to an integer.
Is there a good reason why the id field is text in attachment but integer in ticket and ticket_custom?
I'll be happy to provide my email when Trac provides email munging.
Change History (6)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Probably needs a cast. Where is this error occurring, exactly?
comment:3 by , 18 years ago
|Status:||new → assigned|
comment:4 by , 18 years ago
|Status:||assigned → closed|
 makes sure attachment ids are casted into strings before quering the database (in fetch and select).
Btw, comparing text columns with intergers seems to be possible with PostgreSQL 8.x.
comment:5 by , 18 years ago
|Status:||closed → reopened|
That helped, but it needs to be fixed in one more place.
256c256 < (self.id, when, str(self.id), when, str(self.id), when)) --- > (self.id, when, self.id, when, self.id, when)) 266c266 < "ORDER BY time", (self.id, str(self.id), str(self.id))) --- > "ORDER BY time", (self.id, self.id, self.id))
comment:6 by , 18 years ago
|Status:||reopened → closed|
Thanks, that should be fixed in .
Upon further investigation, it looks like the id field in the attachment can also hold a wiki page name. So the solution above does not work. Need to find something elese.