Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 9 years ago

#3038 closed defect (duplicate)

Report "All Tickets By Milestone" does not work with PostgreSQL

Reported by: anonymous Owned by: daniel
Priority: normal Milestone:
Component: report system Version: 0.9.4
Severity: minor Keywords: PostgreSQL, report, ticket, postgresql
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When I want to view 6th report (All Tickets By Milestone) Trac reports error:

Report execution failed: 
ERROR: column "modified" does not exist 
SELECT p.value AS __color__, t.milestone AS __group__, (CASE status WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;' ELSE (CASE owner WHEN 'mn' THEN 'font-weight: bold' END) END) AS __style__, id AS ticket, summary, component, status, resolution,version, t.type AS type, priority, owner, changetime AS modified, time AS _time,reporter AS _reporter FROM ticket t,enum p WHERE p.name=t.priority AND p.type='priority' ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'), (CASE status WHEN 'closed' THEN modified ELSE (-1)*p.value END) DESC

I have corrected it with change in database:

update report set sql='SELECT p.value AS __color__,
   t.milestone AS __group__,
   (CASE status 
      WHEN ''closed'' THEN ''color: #777; background: #ddd; border-color: #ccc;''
      ELSE 
        (CASE owner WHEN ''$USER'' THEN ''font-weight: bold'' END)
    END) AS __style__,
   id AS ticket, summary, component, status, 
   resolution,version, t.type AS type, priority, owner,
   changetime AS modified,
   time AS _time,reporter AS _reporter
  FROM ticket t,enum p
  WHERE p.name=t.priority AND p.type=''priority''
  ORDER BY (milestone IS NULL), milestone DESC, (status = ''closed''), 
        (CASE status WHEN ''closed'' THEN changetime ELSE (-1)*p.value::int END) DESC
' where id=6;

I have changed:

  1. in ORDER BY I renamed modified to changetime (PostgreSQL doesn't use aliases in ORDER BY)
  2. cast p.value to int

Attachments (0)

Change History (3)

comment:1 by anonymous, 18 years ago

Component: generalreport system
Keywords: PostgreSQL report ticket added
Owner: changed from Jonas Borgström to daniel
Severity: normalminor

comment:2 by Christopher Lenz, 18 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #2123.

comment:3 by Ryan J Ollos, 9 years ago

Keywords: postgresql added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain daniel.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from daniel 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.