Edgewall Software

Opened 18 years ago

Closed 18 years ago

#2116 closed defect (fixed)

Database error in postgres

Reported by: anonymous Owned by: Jonas Borgström
Priority: normal Milestone: 0.9
Component: general Version:
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


 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.

Attachments (0)

Change History (6)

comment:1 by anonymous, 18 years ago

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.

comment:2 by Christopher Lenz, 18 years ago

Probably needs a cast. Where is this error occurring, exactly?

comment:3 by Jonas Borgström, 18 years ago

Status: newassigned

comment:4 by Jonas Borgström, 18 years ago

Resolution: fixed
Status: assignedclosed

[2294] 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 anonymous, 18 years ago

Resolution: fixed
Status: closedreopened
Version: 0.9b1

That helped, but it needs to be fixed in one more place.


<                            (self.id, when, str(self.id), when, str(self.id), when))
>                            (self.id, when, self.id, when, self.id, when))
<                            "ORDER BY time", (self.id,  str(self.id), str(self.id)))
>                            "ORDER BY time", (self.id,  self.id, self.id))

comment:6 by Jonas Borgström, 18 years ago

Resolution: fixed
Status: reopenedclosed

Thanks, that should be fixed in [2302].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.